Hierarchical autoregressive neural networks for statistical systems