#include <bits/stdc++.h>
using namespace std;
bool dfs(vector<vector<int> > &G, vector<bool> &visited, int v) {
  visited[v] = true;
  bool ret = false;
  for (int i = 0; i < G[v].size(); ++i) {
    if (G[v][i] && visited[i]) return true;
    if (G[v][i]) ret |= dfs(G, visited, i);
  }
  return ret;
}
bool has_loop(vector<vector<int> > &G) {
  int n = G.size();
  vector<bool> visited(n, false);
  vector<int> d_in(n, 0);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (G[i][j]) ++d_in[j];
    }
  }
  vector<int> S;
  for (int i = 0; i < n; ++i) {
    if (d_in[i] == 0) S.push_back(i);
  }
  if (S.empty()) {
    return true;
  }
  for (int i = 0; i < S.size(); ++i) {
    if ((!visited[S[i]]) && dfs(G, visited, S[i])) return true;
  }
  return false;
}
int main() {
  int n;
  while (cin >> n, n) {
    vector<string> S(n);
    for (int i = 0; i < n; ++i) {
      cin >> S[i];
    }
    if (n == 1) cout << "yes" << endl;
    vector<vector<int> > G(26, vector<int>(26, 0));
    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].length(), S[i - 1].length()); ++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;
        break;
      }
    }
    if (f) continue;
    if (has_loop(G))
      cout << "no" << endl;
    else
      cout << "yes" << endl;
  }
  return 0;
}
