a,b = eval(input()), eval(input())

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

b=eval(input())

res="No"

if a==b[:-1]:res="Yes"

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

a = eval(input())
b = eval(input())
res = "No"
if a == b[:-1]:
    res = "Yes"
print(res)

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