import Control.Monad
import Data.List
main=do
  n<-readLn
  w<-replicateM n getLine
  putStrLn(if w==(nub w) then (f w n) else "No")
   where f w n = if n==1 then "Yes" else (if (last(w!!0))==(head(w!!1)) then (f (tail w) (n-1)) else "No")