s=eval(input())

t=eval(input())

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

    print("Yes")

else:

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

t=eval(input())

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

    print("Yes")

else:

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

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

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