a = [0]*5
for i in range(3):
  x,y = map(int,input().split())
  a[x] += 1
  a[y] += 1
if sorted(a) == [0,1,1,2,2]:
  print("YES")
else:
  print("NO") a = [0]*5 a [0]*5 [0] 0 5 for i in range(3):
  x,y = map(int,input().split())
  a[x] += 1
  a[y] += 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] a x 1 a[y] += 1 a[y] a y 1 if sorted(a) == [0,1,1,2,2]:
  print("YES")
else:
  print("NO") sorted(a) == [0,1,1,2,2] sorted(a) sorted a [0,1,1,2,2] 0 1 1 2 2 print("YES") print "YES" print("NO") print "NO" y = map(int,input().split()) map(int,input().split()) y a = [0]*5 [0]*5 a x,y = map(int,input().split()) map(int,input().split()) x
a = [0]*5
for i in range(3):
  x,y = map(int,input().split())
  a[x] += 1
  a[y] += 1
if sorted(a) == [0,1,1,2,2]:
  print("YES")
else:
  print("NO")