Many early mosques have a square or rectangular plan . They also have a prayer hall and an enclosed courtyard . These mosques have square or rectangular plans with an enclosed courtyard and covered prayer hall .