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