S = eval(input())

T = eval(input())

flag=0



if len(S)+1 == len(T):

    if S == T[:-1]:

        flag=1

        

    

if flag==1:

    print("Yes")

else:

    print("No")
S = eval(input())

T = eval(input())

flag=0



#if len(S)+1 == len(T):

if S == T[:-1]:

    flag=1

        

    

if flag==1:

    print("Yes")

else:

    print("No")
S = eval(input())
T = eval(input())
flag = 0
if len(S) + 1 == len(T):
    if S == T[:-1]:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

S = eval(input())
T = eval(input())
flag = 0
# if len(S)+1 == len(T):
if S == T[:-1]:
    flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

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