import Control.Monad
import Data.List
check all@(s:str) = if all /= (nub all) then "No" else inCheck (last s) str
 where
  inCheck _ []     = "Yes"
  inCheck c (x:xs) = if (head x == c) then inCheck (last x) xs else "No"
main = do
 r <- readLn
 str <- replicateM r getLine
 putStrLn $ check str