#include using namespace std; using namespace chrono; #if __has_include() #include using namespace atcoder; #endif int main() { int64_t n; cin >> n; vector ss(n); for (auto &&s : ss) { cin >> s; } int64_t cnt = 0; for (auto &&s : ss) { for (auto &&c : s) { if (c == '#') { cnt++; } } } if (n % 2 == 0) { cout << (((cnt % 2 == 0) && ((n * n - cnt) % 2 == 0)) ? "Yes" : "No") << endl; } else { for (int64_t k = 0; k <= n; k++) { if (0 <= cnt - k && (cnt - k) % 2 == 0 && 0 <= n * n - n - (cnt - k) && (n * n - n - (cnt - k)) % 2 == 0) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; } return 0; }