#coding: utf-8

S = eval(input())

T = eval(input())

if S == T[:-1]:

    print("Yes")

else:

    print("No")
s = eval(input())

t = eval(input())

print(("Yes" if s == t[:-1] else "No"))
# coding: utf-8
S = eval(input())
T = eval(input())
if S == T[:-1]:
    print("Yes")
else:
    print("No")

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

-# coding: utf-8 -S = eval(input()) -T = eval(input()) -if S == T[:-1]: -    print("Yes") -else: -    print("No") +s = eval(input()) +t = eval(input()) +print(("Yes" if s == t[:-1] else "No"))