#include <bits/stdc++.h>
using namespace std;
int dp[109][109];
int main() {
  int i, j, n, m, y, q, k;
  scanf("%d", &n);
  char x;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> x;
      if (x == 'x') {
        dp[i][j] = 1;
      } else {
        dp[i][j] = 2;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      int cnt = 0;
      if (dp[i][j - 1] == 2) {
        cnt++;
      }
      if (dp[i][j + 1] == 2) {
        cnt++;
      }
      if (dp[i - 1][j] == 2) {
        cnt++;
      }
      if (dp[i + 1][j] == 2) {
        cnt++;
      }
      if (cnt % 2) {
        cout << "NO" << endl;
        ;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  ;
}
