fun main(arr:Array<String>) {
    val n = readLine()!!.toInt()
    val words = (1..n).map { readLine()!! }
    val isValid = words.size == words.toSet().size &&  (1 until n).all { words[it][0] == words[it-1].last() }
    println(if(isValid) "Yes" else "No")
}

