Al-Hasan said: He should first perform the prostration with the imam, then stand up and complete his prayer.