#include <bits/stdc++.h>
using namespace std;
char str[102][102];
int main() {
  int n, flag, i, j, count;
  while (~scanf("%d", &n)) {
    memset(str, 'x', sizeof str);
    flag = 1;
    for (i = 1; i <= n; i++) {
      scanf("%s", str[i]);
    }
    for (i = 1; i <= n; i++) {
      for (j = 0; j < n; j++) {
        count = 0;
        if (j == 0) {
          if (str[i][j + 1] == 'o') count++;
          if (str[i - 1][j] == 'o') count++;
          if (str[i + 1][j] == 'o') count++;
          if (count % 2) {
            flag = 0;
            break;
          }
        } else {
          if (str[i][j - 1] == 'o') count++;
          if (str[i][j + 1] == 'o') count++;
          if (str[i - 1][j] == 'o') count++;
          if (str[i + 1][j] == 'o') count++;
          if (count % 2) {
            flag = 0;
            break;
          }
        }
      }
    }
    if (flag)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
