main :: IO ()
main = do
	n <- getLine
	xs <- words <$> getContents
	putStrLn $ if shiritori xs then "Yes" else "No"

shiritori :: [String] -> Bool
shiritori [x] = True
shiritori x:y:xs = last x == head y && shiritori y:xs
