from collections import Counter

lis = [0 for i in range(4)]

for i in range(3):

    a,b = list(map(int,input().split()))

    lis[a-1] += 1

    lis[b-1] += 1

if lis.count(2) == 2:

    print("YES")

else:print("NO")
lis = [1,2,2,3,3,4]

li = []

for i in range(3):

    a,b, = list(map(int,input().split()))

    li.append(a)

    li.append(b)

li.sort()

if li == lis:

    print("YES")

else:

    print("NO")
from collections import Counter

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

lis = [1, 2, 2, 3, 3, 4]
li = []
for i in range(3):
    (
        a,
        b,
    ) = list(map(int, input().split()))
    li.append(a)
    li.append(b)
li.sort()
if li == lis:
    print("YES")
else:
    print("NO")

-from collections import Counter - -lis = [0 for i in range(4)] +lis = [1, 2, 2, 3, 3, 4] +li = [] -    a, b = list(map(int, input().split())) -    lis[a - 1] += 1 -    lis[b - 1] += 1 -if lis.count(2) == 2: +    ( +        a, +        b, +    ) = list(map(int, input().split())) +    li.append(a) +    li.append(b) +li.sort() +if li == lis: