#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
char board[111][111];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> board[i][j];
  bool ok = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      int cnt = 0;
      for (int k = 0; k < 4; k++) {
        int y = i + dy[k];
        int x = j + dx[k];
        if (y < 0 || y >= n || x < 0 || x >= n) continue;
        cnt += (board[y][x] == 'o');
      }
      if (cnt % 2 == 1) {
        ok = false;
        break;
      }
    }
  cout << (ok ? "YES" : "NO") << endl;
  return 0;
}
