#include using namespace std; #ifdef local #include #else #define debug(...) #endif #define rep(i, n) for (int i = 0; i < n; i++) template istream& operator>>(istream& I, vector& V) {for (T& X : V) I >> X; return I;} template inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;} template inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;} vector di = {-1, 1, 0, 0}, dj = {0, 0, -1, 1}; int inf = 1e9; long INF = 1e18; int main() { int n; cin >> n; vector s(n); cin >> s; if (n & 1) { cout << "Yes\n"; return 0; } int b = 0, w = 0; rep(i, n) rep(j, n) if (s[i][j] == '#') b++; w = n * n - b; cout << (b & 1 ? "No" : "Yes") << endl; return 0; }