#include <bits/stdc++.h>
using namespace std;
int n;
bool isValid(int i, int j) {
  if (i < 0 || j < 0 || i >= n || j >= n) return false;
  return true;
}
int main() {
  int f = 1;
  cin >> n;
  string line;
  char m[n][n];
  for (int i = 0; i < n; ++i) {
    cin >> line;
    for (int j = 0; j < n; ++j) {
      m[i][j] = line[j];
    }
  }
  for (int i = 0; i < n && f; ++i) {
    for (int j = 0; j < n && f; ++j) {
      int c = 0;
      int iprev = i - 1, inext = i + 1, jprev = j - 1, jnext = j + 1;
      if (isValid(i, jprev))
        if (m[i][jprev] == 'o') c++;
      if (isValid(iprev, j))
        if (m[iprev][j] == 'o') c++;
      if (isValid(i, jnext))
        if (m[i][jnext] == 'o') c++;
      if (isValid(inext, j))
        if (m[inext][j] == 'o') c++;
      if (c % 2 != 0) {
        f = 0;
        break;
      }
    }
  }
  cout << ((f) ? "YES" : "NO") << endl;
  return 0;
}
