#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
char A[105][105];
int n;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> A[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      bool flag = false;
      for (int k = 0; k < 4; k++) {
        if (A[i + dx[k]][j + dy[k]] == 'o') flag ^= true;
      }
      if (flag) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
  return 0;
}
