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
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int,int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
int main() {
	int n;
	while (cin >> n, n) {
		vector<int> G[26]; bool f = true;
		string s, t;
		cin >> t;
		rep(i, n - 1) {
			s = t; cin >> t;
			if (!f)continue;
			int len1 = s.length();
			int len2 = t.length();
			int len = min(len1, len2);
			if (s.substr(0, len) == t.substr(0, len)) {
				if (len1 > len2)f = false;
			}
			else {
				rep(j, len) {
					if (s[j] != t[j]) {
						G[s[j] - 'a'].push_back(t[j] - 'a'); break;
					}
				}
			}
		}
		rep(i, 26) {
			int used[26] = {}; used[i] = 1;
			queue<int> q; q.push(i);
			while (!q.empty()) {
				int v = q.front(); q.pop();
				int len = G[v].size();
				rep(j, len) {
					if (G[v][j] == i) {
						f = false;
					}
					if (!used[G[v][j]]) {
						used[G[v][j]] = 1;
						q.push(G[v][j]);
					}
				}
			}
			if (!f)break;
		}
		if (f) cout << "yes" << endl;
		else cout << "no" << endl;
	}
	return 0;
}
