import Control.Monad
import Data.List (foldl', (\\), nub)

main = do
  n <- readLn
  ws <- replicateM n getLine
  if (ws \\ (nub ws) == []) && (foldl' (\a b -> a && check b) True $ zip ws (tail ws))
  then
    putStrLn "Yes"
  else
    putStrLn "No"
 where 
   check (a,b) = last a == head b