import collections
a, b = map(int, input().split())
c, d = map(int, input().split())
e, f = map(int, input().split())
arr = [a,b,c,d,e,f]
A = collections.Counter(arr).most_common()

if len(A) == 4:
    if A[0][1] == 2 and A[1][1] == 2 and A[2][1] == 1 and A[3][1] == 1:
        print('YES')
    else:
        print('NO')
else:
    print('NO') import collections collections a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b c, d = map(int, input().split()) c map(int, input().split()) map int input().split() ().split () input split d e, f = map(int, input().split()) e map(int, input().split()) map int input().split() ().split () input split f arr = [a,b,c,d,e,f] arr [a,b,c,d,e,f] a b c d e f A = collections.Counter(arr).most_common() A collections.Counter(arr).most_common() collections.Counter(arr).most_common collections.Counter(arr) collections.Counter collections Counter arr most_common if len(A) == 4:
    if A[0][1] == 2 and A[1][1] == 2 and A[2][1] == 1 and A[3][1] == 1:
        print('YES')
    else:
        print('NO')
else:
    print('NO') len(A) == 4 len(A) len A 4 if A[0][1] == 2 and A[1][1] == 2 and A[2][1] == 1 and A[3][1] == 1:
        print('YES')
    else:
        print('NO') A[0][1] == 2 and A[1][1] == 2 and A[2][1] == 1 and A[3][1] == 1 A[0][1] == 2 and A[1][1] == 2 and A[2][1] == 1 A[0][1] == 2 and A[1][1] == 2 A[0][1] == 2 A[0][1] [0] A 0 1 2 A[1][1] == 2 A[1][1] [1] A 1 1 2 A[2][1] == 1 A[2][1] [2] A 2 1 1 A[3][1] == 1 A[3][1] [3] A 3 1 1 print('YES') print 'YES' print('NO') print 'NO' print('NO') print 'NO' arr = [a,b,c,d,e,f] [a,b,c,d,e,f] arr A = collections.Counter(arr).most_common() collections.Counter(arr).most_common() A d = map(int, input().split()) map(int, input().split()) d c, d = map(int, input().split()) map(int, input().split()) c a, b = map(int, input().split()) map(int, input().split()) a e, f = map(int, input().split()) map(int, input().split()) e b = map(int, input().split()) map(int, input().split()) b f = map(int, input().split()) map(int, input().split()) f
import collections
a, b = map(int, input().split())
c, d = map(int, input().split())
e, f = map(int, input().split())
arr = [a,b,c,d,e,f]
A = collections.Counter(arr).most_common()

if len(A) == 4:
    if A[0][1] == 2 and A[1][1] == 2 and A[2][1] == 1 and A[3][1] == 1:
        print('YES')
    else:
        print('NO')
else:
    print('NO')