#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> N; if(N==1){ cout << "Yes" << endl; return 0; } ll s=0; for(i=1;i<=N;i++){ for(j=1;j<=N;j++){ char c; cin >> c; if(c=='#'){ a[i][j]=1; s++; } } } ll d=N; for(i=1;i<=N;i++){ for(j=1;j<=N;j++){ if(a[i][j]==0) continue; if(a[i][j]==a[i][N+1-j]){ if(N%2==0) s-=2; else{ if(j==(N+1)/2){ s--; d--; } else s-=2; } } } } if(s%2==0) cout << "Yes" << endl; else{ if(N%2==0) cout << "No" << endl; else{ if(d!=0) cout << "Yes" << endl; else cout << "No" << endl; } } return 0; }