open Hashtbl
let n = read_int ()
let ws = Array.init n @@ fun _ -> read_line ()
let h = create n
let _ = Array.fold_left (fun p w -> if mem h w || p <> 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"