cnt = [0] * 4
for _ in range(3):
    a, b = tuple(map(int, input().split()))
    cnt[a-1] += 1
    cnt[b-1] += 1
for c in cnt:
    if c >= 3:
        print("NO")
        exit()
print("YES") cnt = [0] * 4 cnt [0] * 4 [0] 0 4 for _ in range(3):
    a, b = tuple(map(int, input().split()))
    cnt[a-1] += 1
    cnt[b-1] += 1 _ range(3) range 3 a, b = tuple(map(int, input().split())) a tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split b cnt[a-1] += 1 cnt[a-1] cnt a-1 a 1 1 cnt[b-1] += 1 cnt[b-1] cnt b-1 b 1 1 for c in cnt:
    if c >= 3:
        print("NO")
        exit() c cnt if c >= 3:
        print("NO")
        exit() c >= 3 c 3 print("NO") print "NO" exit() exit print("YES") print "YES" cnt = [0] * 4 [0] * 4 cnt b = tuple(map(int, input().split())) tuple(map(int, input().split())) b a, b = tuple(map(int, input().split())) tuple(map(int, input().split())) a
cnt = [0] * 4
for _ in range(3):
    a, b = tuple(map(int, input().split()))
    cnt[a-1] += 1
    cnt[b-1] += 1
for c in cnt:
    if c >= 3:
        print("NO")
        exit()
print("YES")