a=eval(input())

b=eval(input())

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

print(("Yes" if eval(input())==input()[:-1] else "No"))
a = eval(input())
b = eval(input())
print(("Yes" if a == b[:-1] and len(a) + 1 == len(b) else "No"))

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

-a = eval(input()) -b = eval(input()) -print(("Yes" if a == b[:-1] and len(a) + 1 == len(b) else "No")) +print(("Yes" if eval(input()) == input()[:-1] else "No"))