The Prophet (PBUH) was delivering a sermon and said: If one of you comes while the Imam is delivering the sermon, let him pray two rak’ahs.
If one of you comes and the imam is delivering the sermon, he should pray two rak'ahs.

404!