S = eval(input())

T = eval(input())



flag = 0

for i in range(len(S)):

	if S[i] != T[i]:

		flag = 1

		break



if flag == 1:

	print("No")

else:

	print("Yes")
S = eval(input())

T = eval(input())

#print(type(S),type(S[0:len(S)]))



#print(T[0:len(T)])



if S == T[0:len(S)]:

	print("Yes")

else:

	print("No")
S = eval(input())
T = eval(input())
flag = 0
for i in range(len(S)):
    if S[i] != T[i]:
        flag = 1
        break
if flag == 1:
    print("No")
else:
    print("Yes")

S = eval(input())
T = eval(input())
# print(type(S),type(S[0:len(S)]))
# print(T[0:len(T)])
if S == T[0 : len(S)]:
    print("Yes")
else:
    print("No")

-flag = 0 -for i in range(len(S)): -    if S[i] != T[i]: -        flag = 1 -        break -if flag == 1: +# print(type(S),type(S[0:len(S)])) +# print(T[0:len(T)]) +if S == T[0 : len(S)]: +    print("Yes") +else: -else: -    print("Yes")