#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define mod 998244353 int main(){ cin.tie(0)->sync_with_stdio(0); cout.tie(0); int N; char A[509][509]; cin>>N; for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++) cin>>A[i][j]; } int shape=0; for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ if(A[i][j]=='#') shape++; } } shape%=N; if(N%2==0){ if(shape%2==0) cout<<"Yes"<