#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  cin >> n;
  char arr[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      count = 0;
      int a = i - 1, b = i + 1, c = j - 1, d = j + 1;
      if (a >= 0 && a < n)
        if (arr[a][j] == 'o') count++;
      if (b >= 0 && b < n)
        if (arr[b][j] == 'o') count++;
      if (c >= 0 && c < n)
        if (arr[i][c] == 'o') count++;
      if (d >= 0 && d < n)
        if (arr[i][d] == 'o') count++;
      if (count & 1) return cout << "NO" << endl, 0;
    }
  }
  return cout << "YES" << endl, 0;
}
