Sayyar bin al-Ma'rur (may Allah have mercy on him) narrates that he heard Sayyiduna Umar (may Allah be pleased with him) delivering a sermon, and he was saying: "Indeed, the Messenger of Allah (peace and blessings be upon him) built this mosque, and we, the Muhajirun and the Ansar, were with him (peace and blessings be upon him). So when the crowding becomes severe, let any man among you prostrate on the back of his brother."
He also saw some people praying in the road and said: "Pray in the mosque."
Related hadith on this topic