#include using namespace std; #define rep(i,a,n) for(int i=(a);i<(n);i++) int main(){ int n,simai=0; bool f=false; cin >> n; vector g(n); rep(i,0,n) cin >> g.at(i); rep(i,0,n){ rep(j,0,n/2){ if(g.at(i).at(j)!=g.at(i).at(n-1-j)){ simai++; } } } if(simai%2==1){ if(n%2==1){ rep(i,0,n){ if(g.at(i).at((n/2))!='#') f=true; } } if(f){ cout << "Yes" << endl; } else cout << "No" << endl; } else cout << "Yes" << endl; }