#include <bits/stdc++.h>
using namespace std;
int a[102][102];
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      char c;
      cin >> c;
      c == 'o' ? a[i][j] = 1 : a[i][j] = 0;
    }
  }
  bool ans = true;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      int cnt = 0;
      for (int k = 0; k < 4; ++k) {
        cnt += a[i + dx[k]][j + dy[k]];
      }
      if (cnt % 2) {
        ans = false;
      }
    }
  }
  if (ans) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
