S = eval(input())

T = eval(input())

if S+T[-1] in T:

  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] in T:
    print("Yes")
else:
    print("No")

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

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