s=eval(input())

t=eval(input())

if t[:-1]==s:

  print("Yes")

else:

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

t=list(eval(input()))

if s==t[:-1]:

  print("Yes")

else:

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

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

-s = eval(input()) -t = eval(input()) -if t[:-1] == s: +s = list(eval(input())) +t = list(eval(input())) +if s == t[:-1]: