dp=[0]*4
for i in range(3):
  a,b=map(int,input().split())
  dp[a-1]+=1
  dp[b-1]+=1
if dp.count(3)==1 or dp.count(0)==1:
  print("NO")
else:
  print("YES") dp=[0]*4 dp [0]*4 [0] 0 4 for i in range(3):
  a,b=map(int,input().split())
  dp[a-1]+=1
  dp[b-1]+=1 i range(3) range 3 a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b dp[a-1]+=1 dp[a-1] dp a-1 a 1 1 dp[b-1]+=1 dp[b-1] dp b-1 b 1 1 if dp.count(3)==1 or dp.count(0)==1:
  print("NO")
else:
  print("YES") dp.count(3)==1 or dp.count(0)==1 dp.count(3)==1 dp.count(3) dp.count dp count 3 1 dp.count(0)==1 dp.count(0) dp.count dp count 0 1 print("NO") print "NO" print("YES") print "YES" b=map(int,input().split()) map(int,input().split()) b dp=[0]*4 [0]*4 dp a,b=map(int,input().split()) map(int,input().split()) a
dp=[0]*4
for i in range(3):
  a,b=map(int,input().split())
  dp[a-1]+=1
  dp[b-1]+=1
if dp.count(3)==1 or dp.count(0)==1:
  print("NO")
else:
  print("YES")