#include <bits/stdc++.h>
using namespace std;
bool dfs(int cur, bool m[30][30], bool used[30]) {
  if (used[cur]) return 1;
  used[cur] = 1;
  bool ret = 0;
  for (int i = 0; i < (27); i++) {
    if (m[cur][i]) ret |= dfs(i, m, used);
  }
  return ret;
}
bool isDAG(bool m[30][30]) {
  bool used[30] = {0};
  bool ret = 0;
  for (int i = 0; i < (27); i++) ret |= dfs(i, m, used);
  return not ret;
}
int main() {
  int n;
  while (cin >> n, n) {
    bool m[30][30] = {{0}};
    char s[505][10];
    for (int i = 0; i < (505); i++)
      for (int j = 0; j < (10); j++) s[i][j] = '\0';
    for (int i = 0; i < (n); i++) cin >> s[i];
    bool ans = true;
    for (int i = 0; i < (n - 1); i++) {
      for (int j = 0; j < (10); j++) {
        if (s[i][j] != '\0' && s[i + 1][j] == '\0') {
          ans = false;
          break;
        } else if (s[i][j] == '\0' || s[i + 1][j] == '\0') {
          break;
        } else if (s[i][j] != s[i + 1][j]) {
          m[s[i][j] - 'a'][s[i + 1][j] - 'a'] = 1;
          break;
        }
      }
    }
    cout << (isDAG(m) && ans ? "Yes" : "No") << endl;
  }
}
