Dictionary#4291

Dictionary

1 second
128 megabytes
Very easy

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 letters. To study their writing, one of us mapped each letter to an English alphabet letter and typed all the words in the dictionary into a computer.

Now we are interested whether the words in the dictionary are ordered lexicographically. As a programmer, you are requested to write a program to check if the words are sorted in lexicographical order.

Note: In lexicographical order, a word always precedes any words for which it is a prefix. For example, "ab" precedes "abc", "abde", and so on.

Input

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

string_1

string_n

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

The end of the input is marked with a line containing "0" and should not be processed.

Output

For each dataset, print either "yes" or "no" on a separate line. If all words in the dataset can be considered sorted lexicographically, print "yes". Otherwise, print "no".

Examples

Example 1

Loading
Loading