#include using namespace std; typedef pair pii; typedef long long ll; typedef pair pli; const int N = 2000086, MOD = 1e9 + 7, INF = 0x3f3f3f3f; ll res; int n, m, cnt, w[N]; char s[508][508]; int main() { cin >> n; m = n; for (int i = 1; i < n + 1; i++) scanf("%s", s[i] + 1); if (m & 1) { if (n & 1) puts("Yes"); else { int c = 0; for (int i = 1; i < n + 1; i++) for (int j = 1; j < m + 1; j++) c += s[i][j] == '#'; if (c % 2 == 0) puts("No"); else puts("Yes"); } } else { int c = 0; for (int i = 1; i < n + 1; i++) for (int j = 1; j < m + 1; j++) c += s[i][j] == '#'; puts(c & 1 ? "No" : "Yes"); } return 0; }