road = [0]*4
for i in range(3):
  a,b = map(int,input().split())
  road[a-1]+=1
  road[b-1]+=1
if max(road)>=3:
  print('NO')
else:
  print('YES') road = [0]*4 road [0]*4 [0] 0 4 for i in range(3):
  a,b = map(int,input().split())
  road[a-1]+=1
  road[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 road[a-1]+=1 road[a-1] road a-1 a 1 1 road[b-1]+=1 road[b-1] road b-1 b 1 1 if max(road)>=3:
  print('NO')
else:
  print('YES') max(road)>=3 max(road) max road 3 print('NO') print 'NO' print('YES') print 'YES' road = [0]*4 [0]*4 road a,b = map(int,input().split()) map(int,input().split()) a b = map(int,input().split()) map(int,input().split()) b
road = [0]*4
for i in range(3):
  a,b = map(int,input().split())
  road[a-1]+=1
  road[b-1]+=1
if max(road)>=3:
  print('NO')
else:
  print('YES')
