s = eval(input())

t = eval(input())

if s + t[-1] == t:

  print("Yes")

else:

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

t = eval(input())

if s == t[:len(s)]:

  print("Yes")

else:

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

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

-if s + t[-1] == t: +if s == t[: len(s)]: