S = eval(input())

T = eval(input())



if S == T[0:len(S)]:

    print('Yes')

else:

    print('No')

S = eval(input())

T = eval(input())



print(('Yes' if S == T[:-1] else 'No'))

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

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

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