x = [0, 0, 0, 0]
for i in range(3):
    a, b = [int(_) for _ in input().split()]
    x[a-1] += 1
    x[b-1] += 1

if max(x) <= 2:
    print("YES")
else:
    print("NO") x = [0, 0, 0, 0] x [0, 0, 0, 0] 0 0 0 0 for i in range(3):
    a, b = [int(_) for _ in input().split()]
    x[a-1] += 1
    x[b-1] += 1 i range(3) range 3 int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ a, b = [int(_) for _ in input().split()] a [int(_) for _ in input().split()] b x[a-1] += 1 x[a-1] x a-1 a 1 1 x[b-1] += 1 x[b-1] x b-1 b 1 1 if max(x) <= 2:
    print("YES")
else:
    print("NO") max(x) <= 2 max(x) max x 2 print("YES") print "YES" print("NO") print "NO" a, b = [int(_) for _ in input().split()] [int(_) for _ in input().split()] a b = [int(_) for _ in input().split()] [int(_) for _ in input().split()] b x = [0, 0, 0, 0] [0, 0, 0, 0] x
x = [0, 0, 0, 0]
for i in range(3):
    a, b = [int(_) for _ in input().split()]
    x[a-1] += 1
    x[b-1] += 1

if max(x) <= 2:
    print("YES")
else:
    print("NO")
