import           Control.Monad
import           Data.List

main :: IO ()
main = do
    n  <- fmap read getLine :: IO Int
    ws <- replicateM n getLine :: IO [String]
    putStrLn $ if iscont ws && not (isdup ws) then "Yes" else "No"

iscont :: [String] -> Bool
iscont ws = all (\(v, w) -> last v == head w) $ zip (init ws) (tail ws)

isdup :: [String] -> Bool
isdup ws = length ws /= length (nub ws)
