Scholars have two different views on this question:  The first view permits using such a building on condition that the place is thoroughly cleansed, while the second disallows prayer in areas and halls used for gaming or dancing and advises the community to look for an alternative place or an open area where prayer may be held. The first view of permissibility is coupled with discouragement.  The late Shaikh Jad al-Haq Ali Jad al-Haq, former Rector of al-Azhar, ruled that prayer in dance halls and places where wine is served and wanton conduct is normal is discouraged, but valid, provided that any physical impurity has been removed.