#include <bits/stdc++.h>
using namespace std;
vector<int> v;
set<int> s;
int n, i, j, sum;
char arr[1000][1000];
int main() {
  cin >> n;
  n += 2;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      arr[i][j] = 'x';
    }
  }
  n -= 2;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> arr[i][j];
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      sum = 0;
      sum += (arr[i + 1][j] == 'o');
      sum += (arr[i - 1][j] == 'o');
      sum += (arr[i][j + 1] == 'o');
      sum += (arr[i][j - 1] == 'o');
      if (sum % 2 != 0) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
