#include <bits/stdc++.h>
using namespace std;
unsigned long long mod = 1000000007;
vector<string> grid;
bool good(int row, int col) {
  int yes = 0;
  if (row - 1 >= 0 and grid[row - 1][col] == 'o') yes++;
  if (col - 1 >= 0 and grid[row][col - 1] == 'o') yes++;
  if (row + 1 < int((grid).size()) and grid[row + 1][col] == 'o') yes++;
  if (col + 1 < int((grid).size()) and grid[row][col + 1] == 'o') yes++;
  return (yes % 2 == 0);
}
int main() {
  int n;
  cin >> n;
  grid.clear();
  string row;
  while (n--) {
    cin >> row;
    grid.push_back(row);
  }
  bool bad = false;
  for (int row = 0; row < int((grid).size()); row++) {
    for (int col = 0; col < int((grid).size()); col++) {
      if (good(row, col))
        continue;
      else {
        bad = true;
      }
    }
  }
  if (bad)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
