import Control.Monad.ST
import Data.Char
 
 
readInt :: IO Int
readInt = read <$> getLine :: IO Int
 
readIntSplit :: IO [Int]
readIntSplit = map read . words <$> getLine :: IO [Int]
 
readStr :: IO String
readStr = getLine
 
readStrSplit :: IO [String]
readStrSplit = map read . words <$> getLine


solve :: String -> String -> String
solve s t
  | s == init t = "Yes"
  | otherwise = "No"

main = do
  s <- readStr
  t <- readStr
  putStrLn $ solve s t