#include <bits/stdc++.h>
using namespace std;
int one[] = {-1, 0, 0, 1};
int two[] = {0, -1, 1, 0};
int main() {
  int n, i, j, k, count, x, y;
  cin >> n;
  char str[n][n];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> str[i][j];
  for (i = 0; i < n && count % 2 == 0; i++)
    for (j = 0; j < n && count % 2 == 0; j++) {
      k = 0;
      count = 0;
      while (k < 4) {
        x = i + one[k];
        y = j + two[k];
        if (x >= 0 && y >= 0 && x < n && y < n && str[x][y] == 'o') count++;
        k++;
      }
    }
  if (i != n || j != n)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
