#include <bits/stdc++.h>
using namespace std;
void ioe() {
  freopen("in_3.txt", "r", stdin);
  freopen("out_3.txt", "w", stdout);
  freopen("er_3.txt", "w", stderr);
}
struct lex_compare {
 public:
  bool operator()(const pair<long long, long long>& lhs,
                  const pair<long long, long long>& rhs) const {
    return (lhs.second > rhs.second);
  }
};
long long pw(long long a, long long b, long long m) {
  if (b == 0) return 1;
  long long t = (pw(a, b / 2, m)) % m;
  t = (t * t) % m;
  if (b % 2 == 0) return t;
  return (a * t) % m;
}
long long gc(long long a, long long b) {
  if (b == 0) return a;
  return gc(b, a % b);
}
vector<string> splt(string x, char w) {
  vector<string> v;
  string s;
  int l = x.length();
  for (long long i = 0; i < l; i++) {
    if (x[i] == w) {
      v.push_back(s);
      s = "";
    } else {
      s.push_back(x[i]);
    }
  }
  v.push_back(s);
  return v;
}
class node {
 public:
  long long id, a, l;
  vector<node*> v;
  vector<pair<node*, long long>> vm;
  node* prt = NULL;
  long long s = -1, x = 0, y = 0;
  node(long long x = 0, long long y = 0) {
    id = y, a = x, l = 0;
    vm.clear(), v.clear();
    prt = NULL;
    s = -1, x = 0, y = 0;
  }
  void adn(node* t) { v.push_back(t), l++; }
  void adn(node* t, long long x) { vm.push_back({t, x}), l++; }
};
node* nnd(long long a = 0, long long i = 1) {
  node* t = new node(a, i);
  return t;
}
void solve() {
  long long n;
  cin >> n;
  char a[n][n];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) cin >> a[i][j];
  long long t = 0;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) {
      long long x = 0;
      if (i > 0 && a[i - 1][j] == 'o') x++;
      if (j > 0 && a[i][j - 1] == 'o') x++;
      if ((i < n - 1) && a[i + 1][j] == 'o') x++;
      if ((j < n - 1) && a[i][j + 1] == 'o') x++;
      if (x % 2 == 1) t++;
    }
  if (t == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  long long f = t;
  while (f--) {
    solve();
  }
}
