solve :: String -> String -> String -> Bool
solve acc [] t = acc == t
solve acc s t
  | acc ++ s == t = True
  | otherwise = solve (last s:acc) (init s) t

main :: IO ()
main = do
  s <- getLine
  t <- getLine
  putStrLn $ if solve "" s t then "Yes" else "No"