#include <bits/stdc++.h>
using namespace std;
bool a_sec(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second < b.second;
}
int n;
bool task(vector<vector<char>> &w, int i, int j) {
  int x = 0;
  if (i - 1 >= 0 && w[i - 1][j] == 'o') x++;
  if (i + 1 < n && w[i + 1][j] == 'o') x++;
  if (j + 1 < n && w[i][j + 1] == 'o') x++;
  if (j - 1 >= 0 && w[i][j - 1] == 'o') x++;
  if (x % 2 == 0 || x == 0)
    return true;
  else
    return false;
}
void solve() {
  cin >> n;
  vector<vector<char>> w(n, vector<char>(n));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> w[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (!task(w, i, j)) {
        cout << "NO";
        return;
      }
  cout << "YES";
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
