fun main(args:Array<String>?): Unit {
    //comparator[a][b] => a.compareTo(b)
    val comparator = Array(26){IntArray(26){0}}
    while(true){
        val n = readLine()!!.trim().toInt()
        if (n == 0) return
        comparator.forEach { it.fill(0) }
        var fail = false
        val words = Array(n){readLine()!!.trim()}
        for (i in 1 until n){
            val prev = words[i - 1]
            val next = words[i]
            for (j in prev.indices){
                if (j !in next.indices){
                    fail = true
                }else if (prev[j] != next[j] && comparator[prev[j].toIndex][next[j].toIndex] == 1){
                    fail = true
                }else if (prev[j] != next[j] && comparator[prev[j].toIndex][next[j].toIndex] == 0){
                    comparator[prev[j].toIndex][next[j].toIndex] = -1
                    comparator[next[j].toIndex][prev[j].toIndex] = 1
                }
                if (j !in next.indices || prev[j] != next[j]) break
            }
        }
        if (!fail){
            outer@for (next in 1 until 26){
                for (prev in 0 until next) {
                    for (mid in 0 until 26) if (comparator[prev][mid] == comparator[mid][next] && comparator[prev][mid] != 0){
                        if (comparator[prev][next] == 0){
                            comparator[prev][next] = comparator[prev][mid]
                            comparator[next][prev] = comparator[mid][prev]
                        }else if (comparator[prev][next] != comparator[prev][mid]) {
                            fail = true
                            break@outer
                        }
                    }
                }
            }
        }
        println(
                if (fail) "no" else "yes"
        )
    }
}
val Char.toIndex: Int
        get() = this - 'a'
