#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::sort;
using std::string;
int main() {
  int n;
  cin >> n;
  int data[102][102];
  int i, j;
  for (i = 0; i < 102; i++) {
    for (j = 0; j < 102; j++) {
      data[i][j] = 0;
    }
  }
  string s;
  for (i = 1; i <= n; i++) {
    cin >> s;
    for (j = 0; j < n; j++) {
      if (s[j] == 'x')
        data[i][j + 1] = 0;
      else
        data[i][j + 1] = 1;
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      int sum =
          data[i][j - 1] + data[i][j + 1] + data[i - 1][j] + data[i + 1][j];
      if (sum % 2 == 1) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
