Problem Statement

We found a dictionary of the Ancient Civilization Mayo (ACM) during excavation of the ruins. After analysis of the dictionary, we revealed they used a language that had not more than 26 letters. So one of us mapped each letter to a different English alphabet and typed all the words in the dictionary into a computer.

How the words are ordered in the dictionary, especially whether they are ordered lexicographically, is an interesting topic to many people. As a good programmer, you are requested to write a program to judge whether we can consider the words to be sorted in a lexicographical order.

Note: In a lexicographical order, a word always precedes other words it is a prefix of. For example, `ab` precedes `abc`, `abde`, and so on.



Input

The input consists of multiple datasets. Each dataset is formatted as follows:


n
string_1
...
string_n


Each dataset consists of n+1 lines. The first line of each dataset contains an integer that indicates n (1 \leq n \leq 500). The i-th line of the following n lines contains string_i, which consists of up to 10 English lowercase letters.

The end of the input is `0`, and this should not be processed.

Output

Print either `yes` or `no` in a line for each dataset, in the order of the input. If all words in the dataset can be considered to be ordered lexicographically, print `yes`. Otherwise, print `no`.

Example

Input

4
cba
cab
b
a
3
bca
ab
a
5
abc
acb
b
c
c
5
abc
acb
c
b
b
0


Output

yes
no
yes
no
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#ifdef int
const ll INF = (1LL<<60);
#else
const int INF = (1LL<<30);
#endif
const double PI = 3.14159265359;
const double EPS = 1e-12;
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

string s[505];
//??°???????????£??\?????????
VI g[30];
//???????????\?¬???°?????????
int h[30];
signed main(void)
{
  while(true) {
    int n;
    cin >> n;
    if(!n) break;
    REP(i, n) cin >> s[i];
    memset(h, 0, sizeof(h));
    REP(i, 30) g[i].clear();

    bool flg = false;
    REP(i, n-1) {
      int sz = min(s[i].size(), s[i+1].size());
      bool update = false;
      REP(j, sz) {
        if(s[i][j] != s[i+1][j]) {
          // s[i][j] ?????? s[i+1][j]???????????????
          g[s[i][j]-'a'].PB(s[i+1][j]-'a');
          h[s[i+1][j]-'a']++;
          update = true;
          break;
        }
      }
      if(!update && s[i].size() > s[i+1].size()) {
        cout << "no" << endl;
        flg = true;
        break;
      }
    }
    if(flg) continue;

    //??\?¬???°???0??????????????????
    stack<int> st;
    //??\?¬???°???0???????????§????????°st?????????
    REP(i, 26) if(h[i] == 0) st.push(i);

    //??????????????????????????°??????
    VI ans;
    //st????????????????????§?????????
    while(st.size()) {
      //st????????????????????????????????????
      int i = st.top(); st.pop();
      ans.push_back(i);
      for(auto& j: g[i]) {
        //??£??\?????????????????\?¬???°???????????????1
        h[j]--;
        //??????????????£?????\?¬???°???0???????????°st?????????
        if(h[j] == 0) st.push(j);
      }
    }

    if(ans.size() == 26) cout << "yes" << endl;
    else cout << "no" << endl;
  }

  return 0;
}