s = eval(input())

t = eval(input())

if t[:-1] == s:

    print('Yes')

else:

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

t = 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 = eval(input())
t = eval(input())
if s == t[:-1]:
    print("Yes")
else:
    print("No")

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