#include <bits/stdc++.h>
using namespace std;
int a[100 + 20][100 + 20];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      char s;
      cin >> s;
      if (s == 'x')
        a[i][j] = 0;
      else
        a[i][j] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if ((a[i - 1][j] + a[i][j - 1] + a[i][j + 1] + a[i + 1][j]) % 2 != 0) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
}
