ab=[tuple(map(int,input().split())) for i in range(3)]
count=[0,0,0,0]
for a,b in ab:
  count[a-1]+=1
  count[b-1]+=1
if max(count)>=3:
  print("NO")
else:
  print("YES") tuple(map(int,input().split())) for i in range(3) for i in range(3) i range(3) range 3 for i in range(3) tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split ab=[tuple(map(int,input().split())) for i in range(3)] ab [tuple(map(int,input().split())) for i in range(3)] count=[0,0,0,0] count [0,0,0,0] 0 0 0 0 for a,b in ab:
  count[a-1]+=1
  count[b-1]+=1 a b ab count[a-1]+=1 count[a-1] count a-1 a 1 1 count[b-1]+=1 count[b-1] count b-1 b 1 1 if max(count)>=3:
  print("NO")
else:
  print("YES") max(count)>=3 max(count) max count 3 print("NO") print "NO" print("YES") print "YES" ab=[tuple(map(int,input().split())) for i in range(3)] [tuple(map(int,input().split())) for i in range(3)] ab count=[0,0,0,0] [0,0,0,0] count
ab=[tuple(map(int,input().split())) for i in range(3)]
count=[0,0,0,0]
for a,b in ab:
  count[a-1]+=1
  count[b-1]+=1
if max(count)>=3:
  print("NO")
else:
  print("YES")