#include <bits/stdc++.h>
using namespace std;
const int oo = int(2e9) + 9;
const double eps = 1e-9;
const double pi = 3.14159265358979323846264338327950;
int main() {
  char grid[105][105];
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin.ignore();
    for (int j = 1; j <= n; j++) scanf("%c", &grid[i][j]);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      int cnt = 0;
      cnt += (grid[i - 1][j] == 'o');
      cnt += (grid[i + 1][j] == 'o');
      cnt += (grid[i][j - 1] == 'o');
      cnt += (grid[i][j + 1] == 'o');
      if (cnt % 2) {
        cout << "NO\n";
        return 0;
      }
    }
  cout << "YES\n";
  return 0;
}
