def resolve():
    a = []
    b = []
    for i in range(3):
        A, B = map(int, input().split())
        a.append(A)
        a.append(B)
    for j in range(1, 5):
        b.append(a.count(j))
    if b.count(2) == 2 and b.count(1) == 2:
        print("YES")
    else:
        print("NO")
resolve() def resolve():
    a = []
    b = []
    for i in range(3):
        A, B = map(int, input().split())
        a.append(A)
        a.append(B)
    for j in range(1, 5):
        b.append(a.count(j))
    if b.count(2) == 2 and b.count(1) == 2:
        print("YES")
    else:
        print("NO") resolve a = [] a [] b = [] b [] for i in range(3):
        A, B = map(int, input().split())
        a.append(A)
        a.append(B)
     i range(3) range 3 A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B a.append(A) a.append a append A a.append(B) a.append a append B for j in range(1, 5):
        b.append(a.count(j))
     j range(1, 5) range 1 5 b.append(a.count(j)) b.append b append a.count(j) a.count a count j if b.count(2) == 2 and b.count(1) == 2:
        print("YES")
    else:
        print("NO") b.count(2) == 2 and b.count(1) == 2 b.count(2) == 2 b.count(2) b.count b count 2 2 b.count(1) == 2 b.count(1) b.count b count 1 2 print("YES") print "YES" print("NO") print "NO" resolve() resolve def resolve():
    a = []
    b = []
    for i in range(3):
        A, B = map(int, input().split())
        a.append(A)
        a.append(B)
    for j in range(1, 5):
        b.append(a.count(j))
    if b.count(2) == 2 and b.count(1) == 2:
        print("YES")
    else:
        print("NO") def resolve():
    a = []
    b = []
    for i in range(3):
        A, B = map(int, input().split())
        a.append(A)
        a.append(B)
    for j in range(1, 5):
        b.append(a.count(j))
    if b.count(2) == 2 and b.count(1) == 2:
        print("YES")
    else:
        print("NO") resolve
def resolve():
    a = []
    b = []
    for i in range(3):
        A, B = map(int, input().split())
        a.append(A)
        a.append(B)
    for j in range(1, 5):
        b.append(a.count(j))
    if b.count(2) == 2 and b.count(1) == 2:
        print("YES")
    else:
        print("NO")
resolve()