import Control.Monad

solver::[String]->Char->[String]->Bool
solver _ _ [] = True
solver says l (x:xs) = if (head x) == l && not (elem x says) then solver (x:says) (last x) xs else False

main::IO()
main=do
  nc<-getLine
  let n = read nc ::Int
  dat<-mapM (\_-> getLine ) [1..n]
  putStr (if solver [(head dat)] (last (head dat)) (tail dat) then "Yes\n" else "No\n")
