Sunan Ibn Majah, Book 4, Hadith 13 (Ibn Majah 747)

It was narrated from 'Umar bin Khattab that:

The Messenger of Allah said: "There are seven places where it is not permissible to perform the prayer: The top of the House of Allah; graveyards; garbage dumps; slaughterhouses; bathrooms; the area that camels rest, and the main road."