It is narrated from Hazrat Abu Saeed Khudri (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: The whole earth is a mosque and a means of purification, except for graveyards and bathhouses.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 11784
Hadith Gradingحکم دارالسلام:حديث صحيح ، محمد بن إسحاق - وإن عنعن - قد توبع