#include <bits/stdc++.h>
using namespace std;
int n;
int ma;
bool checkv(vector<string> &s1) {
  vector<string> s2 = s1;
  map<char, char> m;
  map<char, char> m2;
  char c = 'A';
  for (int i = 0; i < (int)(ma); ++i) {
    for (int j = 0; j < (int)(n); ++j) {
      if ((int)s1[j].length() > i) {
        char cc = s1[j][i];
        if (((m).find(cc) != (m).end())) {
          s2[j][i] = m[cc];
        } else {
          m[cc] = s2[j][i] = c;
          m2[c] = cc;
          c++;
        }
      }
    }
  }
  sort((s2).begin(), (s2).end());
  for (int i = 0; i < (int)(n); ++i) {
    for (int j = 0; j < (int)(s2[i].length()); ++j) {
      s2[i][j] = m2[s2[i][j]];
    }
  }
  for (int i = 0; i < (int)(n); ++i) {
    if (s1[i] != s2[i]) {
      return false;
    }
  }
  return true;
}
bool checkh(vector<string> &s1) {
  vector<string> s2 = s1;
  map<char, char> m;
  map<char, char> m2;
  char c = 'A';
  for (int i = 0; i < (int)(n); ++i) {
    for (int j = 0; j < (int)(ma); ++j) {
      if ((int)s1[i].length() > j) {
        char cc = s1[i][j];
        if (((m).find(cc) != (m).end())) {
          s2[i][j] = m[cc];
        } else {
          m[cc] = s2[i][j] = c;
          m2[c] = cc;
          c++;
        }
      }
    }
  }
  sort((s2).begin(), (s2).end());
  for (int i = 0; i < (int)(n); ++i) {
    for (int j = 0; j < (int)(s2[i].length()); ++j) {
      s2[i][j] = m2[s2[i][j]];
    }
  }
  for (int i = 0; i < (int)(n); ++i) {
    if (s1[i] != s2[i]) {
      return false;
    }
  }
  return true;
}
int main() {
  while (cin >> n) {
    vector<string> s1(n);
    for (int i = 0; i < (int)(n); ++i) {
      cin >> s1[i];
      ma = max(ma, (int)s1[i].length());
    }
    if (checkv(s1) || checkh(s1)) {
      cout << "yes" << endl;
    } else {
      cout << "no" << endl;
    }
  }
}
