Sahih al-Bukhari 275 - If someone while in the mosque remembers that he is Junub, he should leave (the mosque to take a bath) and should not perform Tayammum | Criterion