#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string st1, st3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> st3;
    st1 += st3;
  }
  string st2;
  st2 = st1;
  reverse(st1.begin(), st1.end());
  if (st2 == st1) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
}
