#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;

vector<vector<int>>input(int N) {
	vector<vector<int>>v(N,vector<int>(N));
	for (int i = 0; i < N; ++i) {
		string st;cin>>st;
		for (int j = 0; j < N; ++j) {
			v[i][j]=st[j]=='.';
		}
	}
	return v;
}
vector<vector<int>>rotate(vector<vector<int>>v) {
	int N=v.size();
	vector<vector<int>>nv(v.size(),vector<int>(v.size()));
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			nv[i][j]=v[j][N-1-i];
		}
	}
	return nv;
}
bool operator<(const vector<int>&l, const vector<int>&r) {
	for (int i = 0; i < l.size(); ++i) {
		if(l[i]<r[i])return true;
		else if(l[i]>r[i])return false;
	}
	return false;
}


struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

pair<int, vector<int>>solve(pair<int, vector<int>>p, vector<vector<int>>field) {
	int dx[] = { -1,0,1,0 };
	int dy[] = { 0,1,0,-1 };

	const int start_id=p.first;
	const vector<int> v=p.second;

	int N=field.size();
	UnionFind uf(N*(N+1)+1);

	for (int i = 0; i < N; ++i) {
		if (v[i] == start_id) {
			uf.unionSet(i,N*(N+1));
		}
		for (int j = 0; j < N; ++j) {
			if (v[i] == v[j]) {
				uf.unionSet(i,j);
			}
		}
		if (p.second[i]&&field[i][0]) {
			uf.unionSet(i,i+N);
		}
	}
	for (int y = 0; y < N; ++y) {
		for (int x = 0; x < N; ++x) {
			for (int way = 0; way < 4; ++way) {
				int nx=x+dx[way];
				int ny=y+dy[way];
				if (nx >= 0 && nx < N&&ny >= 0 && ny < N) {
					if(field[y][x]&&field[ny][nx])uf.unionSet(x*N+N+y,nx*N+N+ny);
				}
			}
		}
	}

	vector<int>right_v(N);
	const int right_start=uf.root(N*(N+1));
	for (int i = 0; i < N; ++i) {
		right_v[i]=uf.root(N*N+i);
	}
	
	map<int,int>mp;

	vector<int>right_nv(N);
	int id=1;
	for (int i = 0; i < N; ++i) {
		if (field[i][N - 1]) {
			if (mp.find(right_v[i]) == mp.end()) {
				mp[right_v[i]]=id++;
			}
			right_nv[i]=mp[right_v[i]];
		}
		else {
			right_nv[i]=0;
		}
	}
	if (mp.find(right_start) == mp.end()) {
		return make_pair(-1,right_nv);
	}
	else {
		return make_pair(mp[right_start],right_nv);
	}
}

int main()
{
	while (true) {
		int N,M;cin>>N>>M;
		if(!N)break;
		set<pair<int,vector<int>>>mp;
		mp.emplace(make_pair(1,vector<int>(N,1)));

		for (int i = 0; i < M; ++i) {
			set<pair<int, vector<int>>>n_mp;
			vector<vector<int>>field = input(N);
			for (auto v : mp) {
				for (int way = 0; way < 4; ++way) {
					field=rotate(field);
					auto np=solve(v,field);

					if (np.first == -1) {
						continue;
					}
					n_mp.emplace(np);
				}
			}

			mp=n_mp;
		}

		if (mp.empty()) {
			cout<<"No"<<endl;
		}
		else {
			cout<<"Yes"<<endl;
		}
	}
	return 0;
}

