import Control.Monad
import Data.List
main = readLn >>= \n -> replicateM n getLine >>= \ws -> putStrLn (if (length . group . sort) ws == n && all (\(w1, w2) -> last w1 == head w2) (zip ws (tail ws)) then "Yes" else "No")