li = []
for i in range(3):	
  a,b = map(int,input().split())
  li.append(a)
  li.append(b)
li.sort()
if li==[1, 2, 2, 3, 3, 4]:
  print("YES")
else:
  print("NO") li = [] li [] for i in range(3):	
  a,b = map(int,input().split())
  li.append(a)
  li.append(b) i range(3) range 3 a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b li.append(a) li.append li append a li.append(b) li.append li append b li.sort() li.sort li sort if li==[1, 2, 2, 3, 3, 4]:
  print("YES")
else:
  print("NO") li==[1, 2, 2, 3, 3, 4] li [1, 2, 2, 3, 3, 4] 1 2 2 3 3 4 print("YES") print "YES" print("NO") print "NO" li = [] [] li a,b = map(int,input().split()) map(int,input().split()) a b = map(int,input().split()) map(int,input().split()) b
li = []
for i in range(3):	
  a,b = map(int,input().split())
  li.append(a)
  li.append(b)
li.sort()
if li==[1, 2, 2, 3, 3, 4]:
  print("YES")
else:
  print("NO")