open Hashtbl
let n = Scanf.scanf " %d" (+) 0
let ws = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let h = create n
let _ = Array.fold_left (fun c w -> if mem h w || c <> w.[0] then (print_endline "No"; exit 0); add h w 1; w.[String.length w - 1]) ws.(0).[0] ws |> ignore; print_endline "Yes"