import Control.Monad(replicateM)
import Data.List(sort)
f1 :: String -> String -> Bool
f1 s1 s2 = (length s1 < length s2) && (s1 == take (length s1) s2)
f2 :: String -> String -> Bool
f2 s1 s2  = any (\xs -> xs) (zipWith (/=) s1 s2)

main = do
    [a,b] <- replicateM 2 getLine
    putStrLn $ if f1 a b || f2 a b then "Yes" else "No"