import Data.List

main = do
 _ <- getLine
 s <- lines<$>getContents
 putStr $ solve s

solve s = if (s == nub s) && check s then "Yes" else "No"

check :: [[Char]] -> Bool
check [] = True
check [a] = True
check (a:b:x) = (last a == head b) && check (b:x)