let scan1 f = stdin.ReadLine() |> f
let scanVecV f n = [| for i in 1..n -> stdin.ReadLine() |> f |]

let n = scan1 int
let xs = scanVecV string n

let isUniq str = xs |> Array.filter ((=) str) |> Array.length |> (=) 1

let isOK str1 str2 =
  (Seq.last str1) = (Seq.head str2) && (isUniq str1) && (isUniq str2)

xs
|> Seq.pairwise
|> Seq.forall (fun (x1,x2) -> isOK x1 x2)
|> fun b -> if b then "Yes" else "No"
|> printfn "%s"
