lista = []
for i in range(3):
  a,b = map(int,input().split())
  lista.append(a)
  lista.append(b)
l1 = 0
l2 = 0
l3 = 0
l4 = 0
for j in lista:
  if j == 1:
    l1 += 1
  if j == 2:
    l2 += 1
  if j == 3:
    l3 += 1
  if j == 4:
    l4 += 1
c = (l1)%2 + (l2)%2 + (l3)%2 + (l4)%2
if c <= 2:
  print('YES')
else:
  print('NO')
   lista = [] lista [] for i in range(3):
  a,b = map(int,input().split())
  lista.append(a)
  lista.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 lista.append(a) lista.append lista append a lista.append(b) lista.append lista append b l1 = 0 l1 0 l2 = 0 l2 0 l3 = 0 l3 0 l4 = 0 l4 0 for j in lista:
  if j == 1:
    l1 += 1
  if j == 2:
    l2 += 1
  if j == 3:
    l3 += 1
  if j == 4:
    l4 += 1 j lista if j == 1:
    l1 += 1
   j == 1 j 1 l1 += 1 l1 1 if j == 2:
    l2 += 1
   j == 2 j 2 l2 += 1 l2 1 if j == 3:
    l3 += 1
   j == 3 j 3 l3 += 1 l3 1 if j == 4:
    l4 += 1 j == 4 j 4 l4 += 1 l4 1 c = (l1)%2 + (l2)%2 + (l3)%2 + (l4)%2 c (l1)%2 + (l2)%2 + (l3)%2 + (l4)%2 (l1)%2 + (l2)%2 + (l3)%2 (l1)%2 + (l2)%2 (l1)%2 l1 2 (l2)%2 l2 2 (l3)%2 l3 2 (l4)%2 l4 2 if c <= 2:
  print('YES')
else:
  print('NO')
   c <= 2 c 2 print('YES') print 'YES' print('NO') print 'NO' l4 += 1 1 l4 lista = [] [] lista c = (l1)%2 + (l2)%2 + (l3)%2 + (l4)%2 (l1)%2 + (l2)%2 + (l3)%2 + (l4)%2 c l2 = 0 0 l2 l4 = 0 0 l4 l2 += 1 1 l2 b = map(int,input().split()) map(int,input().split()) b l3 = 0 0 l3 l1 += 1 1 l1 l1 = 0 0 l1 a,b = map(int,input().split()) map(int,input().split()) a l3 += 1 1 l3
lista = []
for i in range(3):
  a,b = map(int,input().split())
  lista.append(a)
  lista.append(b)
l1 = 0
l2 = 0
l3 = 0
l4 = 0
for j in lista:
  if j == 1:
    l1 += 1
  if j == 2:
    l2 += 1
  if j == 3:
    l3 += 1
  if j == 4:
    l4 += 1
c = (l1)%2 + (l2)%2 + (l3)%2 + (l4)%2
if c <= 2:
  print('YES')
else:
  print('NO')
  
