s = eval(input())

t = eval(input())

l = len(t)-1

if s == t[:l]:

    print('Yes')

else:

    print('No')
s = input()

t = input()

l = len(t)-1

print('Yes') if s == t[:l] else print('No')

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

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

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