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 <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<ll, ll> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int main()
{
	int n;
	while (cin >> n, n)
	{
		vector<vi> g(27);
		vs v;
		REP(i, n)
		{
			string s; cin >> s;
			while (s.size() < 10) s += 'z' + 1;
			v.push_back(s);
		}
		REP(i, n)REP(j, i)
		{
			string u = v[i], d = v[j];
			int t = 0;
			while (u[t] == d[t]&&t<10) t++;
			if (t == 10) continue;
			int un = u[t] - 'a', dn = d[t] - 'a';
			if (un != dn) g[un].push_back(dn);
		}
		bool f = true;
		if (g[26].size() > 0) f = false;
		REP(i, 26)
		{
			sort(ALL(g[i]));
			g[i].erase(unique(ALL(g[i])), g[i].end());
		}
		vector<bool> vis(26);
		REP(i, 26)
		{
			stack<pii> st;
			st.push(pii(i, 0));
			while (st.size())
			{
				int tmp = st.top().first, cnt = st.top().second;
				st.pop();
				if (cnt>30)
				{
					f = false;
					goto end;
				}
				REP(j, g[tmp].size())
				{
					st.push(pii(g[tmp][j], cnt+1));
				}
			}
		}
	end:;
		puts(f ? "yes" : "no");
	}
	return 0;
}