a = [0] * 4
for i in range(3) :
  x, y = map(int, input().split())
  a[x-1] = a[x-1] + 1
  a[y-1] = a[y-1] + 1
if a[0] ^ a[1] ^ a[2] ^ a[3] == 0 : print("YES")
else : print("NO") a = [0] * 4 a [0] * 4 [0] 0 4 for i in range(3) :
  x, y = map(int, input().split())
  a[x-1] = a[x-1] + 1
  a[y-1] = a[y-1] + 1 i range(3) range 3 x, y = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split y a[x-1] = a[x-1] + 1 a[x-1] a x-1 x 1 a[x-1] + 1 a[x-1] a x-1 x 1 1 a[y-1] = a[y-1] + 1 a[y-1] a y-1 y 1 a[y-1] + 1 a[y-1] a y-1 y 1 1 if a[0] ^ a[1] ^ a[2] ^ a[3] == 0 : print("YES")
else : print("NO") a[0] ^ a[1] ^ a[2] ^ a[3] == 0 a[0] ^ a[1] ^ a[2] ^ a[3] a[0] ^ a[1] ^ a[2] a[0] ^ a[1] a[0] a 0 a[1] a 1 a[2] a 2 a[3] a 3 0 a = [0] * 4 [0] * 4 a x, y = map(int, input().split()) map(int, input().split()) x y = map(int, input().split()) map(int, input().split()) y
a = [0] * 4
for i in range(3) :
  x, y = map(int, input().split())
  a[x-1] = a[x-1] + 1
  a[y-1] = a[y-1] + 1
if a[0] ^ a[1] ^ a[2] ^ a[3] == 0 : print("YES")
else : print("NO")