#include <bits/stdc++.h>
using namespace std;
int n, l, m, i, j, ans = 0;
char a[110][110];
int main() {
  cin >> n;
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j) cin >> a[i][j];
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j) {
      int k = 0;
      if (a[i][j - 1] == 'o') k++;
      if (a[i][j + 1] == 'o') k++;
      if (a[i + 1][j] == 'o') k++;
      if (a[i - 1][j] == 'o') k++;
      if (k & 1) {
        cout << "NO\n";
        return 0;
      }
    }
  cout << "YES\n";
  return 0;
}
