ab = [0 for _ in range(4)]
for _ in range(3):
    a, b = map(int, input().split())
    ab[a - 1] += 1
    ab[b - 1] += 1
if ab.count(1) == 2 and ab.count(2) == 2:
    print("YES")
else:
    print("NO") 0 for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) 0 ab = [0 for _ in range(4)] ab [0 for _ in range(4)] for _ in range(3):
    a, b = map(int, input().split())
    ab[a - 1] += 1
    ab[b - 1] += 1 _ range(3) range 3 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b ab[a - 1] += 1 ab[a - 1] ab a - 1 a 1 1 ab[b - 1] += 1 ab[b - 1] ab b - 1 b 1 1 if ab.count(1) == 2 and ab.count(2) == 2:
    print("YES")
else:
    print("NO") ab.count(1) == 2 and ab.count(2) == 2 ab.count(1) == 2 ab.count(1) ab.count ab count 1 2 ab.count(2) == 2 ab.count(2) ab.count ab count 2 2 print("YES") print "YES" print("NO") print "NO" a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b ab = [0 for _ in range(4)] [0 for _ in range(4)] ab
ab = [0 for _ in range(4)]
for _ in range(3):
    a, b = map(int, input().split())
    ab[a - 1] += 1
    ab[b - 1] += 1
if ab.count(1) == 2 and ab.count(2) == 2:
    print("YES")
else:
    print("NO")