s, t = [eval(input()) for i in range(2)]

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

s, t = [eval(input()) for _ in range(2)]

print(('Yes' if s == t[:len(s):] else 'No'))
s, t = [eval(input()) for i in range(2)]
print(("Yes" if s == t[: len(s) :] else "No"))

s, t = [eval(input()) for _ in range(2)]
print(("Yes" if s == t[: len(s) :] else "No"))

-s, t = [eval(input()) for i in range(2)] +s, t = [eval(input()) for _ in range(2)]