#coding:utf-8
ans = [0] * 4

for i in range(3):
  a, b = map(int, input().split())
  ans[a-1] += 1
  ans[b-1] += 1
  
for i in ans:
  if i >= 3:
    print("NO")
    exit()

print("YES")
   ans = [0] * 4 ans [0] * 4 [0] 0 4 for i in range(3):
  a, b = map(int, input().split())
  ans[a-1] += 1
  ans[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 ans[a-1] += 1 ans[a-1] ans a-1 a 1 1 ans[b-1] += 1 ans[b-1] ans b-1 b 1 1 for i in ans:
  if i >= 3:
    print("NO")
    exit() i ans if i >= 3:
    print("NO")
    exit() i >= 3 i 3 print("NO") print "NO" exit() exit print("YES") print "YES" ans = [0] * 4 [0] * 4 ans b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
#coding:utf-8
ans = [0] * 4

for i in range(3):
  a, b = map(int, input().split())
  ans[a-1] += 1
  ans[b-1] += 1
  
for i in ans:
  if i >= 3:
    print("NO")
    exit()

print("YES")
  
