Abu Musa Ashari reported,

The Messenger of Allah ﷺ said, "The people who receive the greatest reward for prayer are those who walk the farthest to reach it, then those next farthest. And the one who waits to pray until he prays it with the imam has a greater reward than the one who prays it and then goes to sleep."In the narration of Abu Kurayb, the wording is, "until he prays it with the imam in congregation."

Muslim 1513

Sahih

حدثنا عبد الله بن براد الأشعري وأبو كريب قالا حدثنا أبو أسامة عن بريد عن أبي بردة

عن أبي موسى قال

قال رسول الله ﷺ إن أعظم الناس أجرا في الصلاة أبعدهم إليها ممشى فأبعدهم والذي ينتظر الصلاة حتى يصليها مع الإمام أعظم أجرا من الذي يصليها ثم ينام وفي رواية أبي كريب حتى يصليها مع الإمام في جماعة

مسلم 1513صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Virtue of taking many steps to the mosques
Numbering
Darussalam 1513
Muslim 1513