# coding: utf-8
# Your code here!
x = []
for i in range(3):
    p, q = map(int, input().split())
    x.append(p)
    x.append(q)
ans = []
for i in range(4):
    ans.append(x.count(i + 1))
ans.sort()
if ans == [1, 1, 2, 2]:
    print('YES')
else:
    print('NO') x = [] x [] for i in range(3):
    p, q = map(int, input().split())
    x.append(p)
    x.append(q) i range(3) range 3 p, q = map(int, input().split()) p map(int, input().split()) map int input().split() ().split () input split q x.append(p) x.append x append p x.append(q) x.append x append q ans = [] ans [] for i in range(4):
    ans.append(x.count(i + 1)) i range(4) range 4 ans.append(x.count(i + 1)) ans.append ans append x.count(i + 1) x.count x count i + 1 i 1 ans.sort() ans.sort ans sort if ans == [1, 1, 2, 2]:
    print('YES')
else:
    print('NO') ans == [1, 1, 2, 2] ans [1, 1, 2, 2] 1 1 2 2 print('YES') print 'YES' print('NO') print 'NO' q = map(int, input().split()) map(int, input().split()) q ans = [] [] ans x = [] [] x p, q = map(int, input().split()) map(int, input().split()) p
# coding: utf-8
# Your code here!
x = []
for i in range(3):
    p, q = map(int, input().split())
    x.append(p)
    x.append(q)
ans = []
for i in range(4):
    ans.append(x.count(i + 1))
ans.sort()
if ans == [1, 1, 2, 2]:
    print('YES')
else:
    print('NO')
