#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize "-O3"
const int N = (1e5 + 5);
const int64_t MOD = 1e9;
const int64_t INF = 1e18;
int n, m;
bool ans = 1;
string arr[N];
bool check(int x, int y) {
  int cnt = 0;
  if (x > 0) cnt += (arr[x - 1][y] == 'o');
  if (x < n - 1) cnt += (arr[x + 1][y] == 'o');
  if (y > 0) cnt += (arr[x][y - 1] == 'o');
  if (y < n - 1) cnt += (arr[x][y + 1] == 'o');
  return ((cnt % 2) == 0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) ans &= check(i, j);
  cout << (ans ? "YES\n" : "NO\n");
  return 0;
}
