S = eval(input())

T = eval(input())



def f(S, T):

    if len(T) - len(S) != 1:

        return 'No'

    for i in range(len(S)):

        if S[i] != T[i]:

            return 'No'

    return 'Yes'



print((f(S, T)))
S = eval(input())

T = eval(input())



def f():

    if S == T[:len(T) - 1]:

        return 'Yes'

    else:

        return 'No'



print((f()))

S = eval(input())
T = eval(input())


def f(S, T):
    if len(T) - len(S) != 1:
        return "No"
    for i in range(len(S)):
        if S[i] != T[i]:
            return "No"
    return "Yes"


print((f(S, T)))

S = eval(input())
T = eval(input())


def f():
    if S == T[: len(T) - 1]:
        return "Yes"
    else:
        return "No"


print((f()))

-def f(S, T): -    if len(T) - len(S) != 1: +def f(): +    if S == T[: len(T) - 1]: +        return "Yes" +    else: -    for i in range(len(S)): -        if S[i] != T[i]: -            return "No" -    return "Yes" -print((f(S, T))) +print((f()))