a=eval(input())

b=eval(input())

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

else: print('No')
a=eval(input())

b=eval(input())

if a==b[:-1]: print('Yes')

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

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

-if a == b[:-1] and len(b) == len(a) + 1: +if a == b[:-1]: