#include <bits/stdc++.h>
using namespace std;
string str[510];
bool has_loop(vector<vector<int>> G) {
  int n = G.size();
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (G[i][i] < 1e9) return true;
  }
  return false;
}
int main() {
  int n;
  int max_len = 0;
  while (cin >> n, n) {
    vector<string> s(n);
    for (int i = 0; i < n; i++) cin >> s[i];
    if (n == 1) {
      cout << "Yes" << endl;
      continue;
    }
    vector<vector<int>> G(26, vector<int>(26, 1e9));
    bool f = true;
    for (int i = 1; i < n; i++) {
      if (s[i - 1] == s[i]) continue;
      for (int j = 0; j < min(s[i].size(), s[i - 1].size()); j++) {
        f = true;
        if (s[i][j] != s[i - 1][j]) {
          G[s[i - 1][j] - 'a'][s[i][j] - 'a'] = 1;
          f = false;
          break;
        }
      }
      if (f && s[i - 1].size() > s[i].size()) {
        cout << "no" << endl;
        goto E;
      } else {
        f = false;
      }
    }
    if (has_loop(G))
      cout << "no" << endl;
    else
      cout << "yes" << endl;
  E:;
  }
}
