Jami` at-Tirmidhi, Book 6, Hadith 48 (Tirmidhi 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."