Provable Long-Range Benefits of Next-Token Prediction