print(('YNeos'[len(set(input().split()))>1::2]))
a,b,c=input().split();print(('YNeos'[b!=c::2]))
print(("YNeos"[len(set(input().split())) > 1 :: 2]))

a, b, c = input().split()
print(("YNeos"[b != c :: 2]))

-print(("YNeos"[len(set(input().split())) > 1 :: 2])) +a, b, c = input().split() +print(("YNeos"[b != c :: 2]))