Sunan At-Tirmidhi

Hadith #591

Mu'adh bin Jabal narrated that :the Messenger of Allah said: ""When one of you comes to the Salat and (finds) the Imam is in a position, then do as the Imam is doing