Jami` at-Tirmidhi, Book 2, Hadith 169 (Tirmidhi 317)

Abu Sa'eed Al-Khudri narrated that :

Allah's Messenger said: "All of the earth is a Masjid except for the graveyard and the washroom."