import Data.List

judge :: [String] -> Bool
judge words = and $ zipWith (\x y -> last x == head y) words (tail words)

main = do
  words <- lines <$> (getLine >> getContents)
  if length (nub words) < length words then putStrLn "No"
  else if judge words then putStrLn "Yes" else putStrLn "No"