object Main extends App {
  @scala.annotation.tailrec
  def loop(words: Seq[String], previous: String, history: List[String]): Boolean =
    words match {
      case Seq() => true
      case x :: _ if history.contains(x) || previous.last != x.head => false
      case x :: xs => loop(xs, x, x :: history)
    }
  val sc = new java.util.Scanner(System.in)
  val first :: words = List.fill(sc.nextInt())(sc.next())
  println(if (loop(words, first, List(first))) "Yes" else "No")
}
