#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int n, temp;
  cin >> n;
  char a[150][150];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 1; j < n - 1; j++)
    for (int i = 1; i < n - 1; i++) {
      int temp = 0;
      if (a[i + 1][j] == 'o') ++temp;
      if (a[i - 1][j] == 'o') ++temp;
      if (a[i][j + 1] == 'o') ++temp;
      if (a[i][j - 1] == 'o') ++temp;
      if (temp % 2) {
        cout << "NO\n";
        return 0;
      }
    }
  for (int j = 1; j < n - 1; j++) {
    int temp = 0;
    if (a[0][j - 1] == 'o') ++temp;
    if (a[0][j + 1] == 'o') ++temp;
    if (a[1][j] == 'o') ++temp;
    if (temp % 2) {
      cout << "NO\n";
      return 0;
    }
  }
  for (int j = 1; j < n - 1; j++) {
    int temp = 0;
    if (a[n - 1][j - 1] == 'o') ++temp;
    if (a[n - 1][j + 1] == 'o') ++temp;
    if (a[n - 2][j] == 'o') ++temp;
    if (temp % 2) {
      cout << "NO\n";
      return 0;
    }
  }
  for (int j = 1; j < n - 1; j++) {
    int temp = 0;
    if (a[j - 1][0] == 'o') ++temp;
    if (a[j + 1][0] == 'o') ++temp;
    if (a[j][1] == 'o') ++temp;
    if (temp % 2) {
      cout << "NO\n";
      return 0;
    }
  }
  for (int j = 1; j < n - 1; j++) {
    int temp = 0;
    if (a[j - 1][n - 1] == 'o') ++temp;
    if (a[j + 1][n - 1] == 'o') ++temp;
    if (a[j][n - 2] == 'o') ++temp;
    if (temp % 2) {
      cout << "NO\n";
      return 0;
    }
  }
  temp = 0;
  if (a[0][1] == 'o') ++temp;
  if (a[1][0] == 'o') ++temp;
  if (temp % 2) {
    cout << "NO\n";
    return 0;
  }
  if (a[0][n - 2] == 'o') ++temp;
  if (a[1][n - 1] == 'o') ++temp;
  if (temp % 2) {
    cout << "NO\n";
    return 0;
  }
  if (a[n - 1][1] == 'o') ++temp;
  if (a[n - 2][0] == 'o') ++temp;
  if (temp % 2) {
    cout << "NO\n";
    return 0;
  }
  if (a[n - 2][n - 1] == 'o') ++temp;
  if (a[n - 1][n - 2] == 'o') ++temp;
  if (temp % 2) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  return 0;
}
