fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val W = Array(N) { readLine()!! }
    if (W.distinct().size != W.size) {
        println("No")
        return
    }

    var last = W[0].last()
    for (i in 1 until W.size) {
        if (W[i].first() != last) {
            println("No")
            return
        }
        last = W[i].last()
    }
    println("Yes")
}