from collections import Counter
import sys
A = []
for i in range(3):
    a,b = map(int,input().split())
    A.append(a)
    A.append(b)
c = Counter(A)
for i in c.values():
    if i >=3:
        print('NO')
        sys.exit()
print('YES') from collections import Counter import sys sys A = [] A [] 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 c = Counter(A) c Counter(A) Counter A for i in c.values():
    if i >=3:
        print('NO')
        sys.exit() i c.values() c.values c values if i >=3:
        print('NO')
        sys.exit() i >=3 i 3 print('NO') print 'NO' sys.exit() sys.exit sys exit print('YES') print 'YES' a,b = map(int,input().split()) map(int,input().split()) a c = Counter(A) Counter(A) c A = [] [] A b = map(int,input().split()) map(int,input().split()) b
from collections import Counter
import sys
A = []
for i in range(3):
    a,b = map(int,input().split())
    A.append(a)
    A.append(b)
c = Counter(A)
for i in c.values():
    if i >=3:
        print('NO')
        sys.exit()
print('YES')