print(('YNEOS'[sum(map(int,open(0).read().split()))!=15::2]))
print(('NYOE S'[sum(map(int,open(0).read().split()))%2::2]))
print(("YNEOS"[sum(map(int, open(0).read().split())) != 15 :: 2]))

print(("NYOE S"[sum(map(int, open(0).read().split())) % 2 :: 2]))

-print(("YNEOS"[sum(map(int, open(0).read().split())) != 15 :: 2])) +print(("NYOE S"[sum(map(int, open(0).read().split())) % 2 :: 2]))