S = eval(input())

T = eval(input())



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

    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[:-1] and len(T) == len(S) + 1:
    print("Yes")
else:
    print("No")

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

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