module Main where

import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Control.Monad
import Data.List

main :: IO ()
main = do
    s <- getLine
    t <- getLine
    let tmp = take (length s) t
    let tmp2 = last t
    print tmp
    print tmp2
    putStr $ if tmp == s && 'a' <= tmp2 && tmp2 <= 'z' then "Yes" else "No"