node = set([1,2,3,4])
for _ in range(3):
  a,b = map(int,input().split())
  node = node.intersection(set([a,b]))
  
print('NO' if len(node) else 'YES') node = set([1,2,3,4]) node set([1,2,3,4]) set [1,2,3,4] 1 2 3 4 for _ in range(3):
  a,b = map(int,input().split())
  node = node.intersection(set([a,b]))
   _ range(3) range 3 a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b node = node.intersection(set([a,b])) node node.intersection(set([a,b])) node.intersection node intersection set([a,b]) set [a,b] a b print('NO' if len(node) else 'YES') print 'NO' if len(node) else 'YES' len(node) len node 'NO' 'YES' node = set([1,2,3,4]) set([1,2,3,4]) node node = node.intersection(set([a,b])) node.intersection(set([a,b])) node b = map(int,input().split()) map(int,input().split()) b a,b = map(int,input().split()) map(int,input().split()) a
node = set([1,2,3,4])
for _ in range(3):
  a,b = map(int,input().split())
  node = node.intersection(set([a,b]))
  
print('NO' if len(node) else 'YES')