Abu Musa al-Ash'ari (may Allah be pleased with him) narrates from the Prophet (peace and blessings be upon him): "The person who receives the greatest reward is the one who comes to the mosque walking from far away; and the servant who waits for the congregational prayer and then prays is more deserving of reward than the one who prays alone and then goes to sleep."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النذور / 20106