s=eval(input())

t=input()[:-1]

print(("Yes" if s==t else "No"))
s=eval(input())

t=input()[:-1]

if s==t:

  print("Yes")

else:

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

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

-print(("Yes" if s == t else "No")) +if s == t: +    print("Yes") +else: +    print("No")