{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as B 
import qualified Data.Set as S
import Control.Monad 

main :: IO ()
main = readLn >>= main'
    where
        main' n = replicateM n B.getLine >>= B.putStrLn . solve 

solve :: [B.ByteString] -> B.ByteString
solve (x : xs)
    | check x xs = "Yes"
    | otherwise = "No"
    where
        check p = cf (S.singleton p) p
        cf s p (w : ws)
            | not (S.member w s) && B.last p == B.head w = cf (S.insert w s) w ws
            | otherwise = False
        cf _ _ _ = True