import qualified Data.ByteString.Char8 as BS

main = do
  a <- BS.unpack <$> BS.getLine
  b <- BS.unpack <$> BS.getLine
  let len_a = length a
  let tail_b = drop len_a b
  let b' = b !! 0
  if a == take (len_a) b && length tail_b == 1 && 'a' <= b' && b' <= 'z' then
    putStrLn $ "Yes"
  else
    putStrLn $ "No"