s = eval(input())

t = input()[:-1]

if s == t:

    print("Yes")

else:

    print("No")

S = eval(input())

T = eval(input())

if S == T[:-1]:

    print("Yes")

else:

    print("No")

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

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

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