c=[]
for i in range(3):
    a,b=map(int,input().split())
    c.append(a)
    c.append(b)
if c.count(1)<3 and c.count(2)<3 and c.count(3)<3 and c.count(4)<3:
    print('YES')
else:
    print('NO') c=[] c [] for i in range(3):
    a,b=map(int,input().split())
    c.append(a)
    c.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 c.append(a) c.append c append a c.append(b) c.append c append b if c.count(1)<3 and c.count(2)<3 and c.count(3)<3 and c.count(4)<3:
    print('YES')
else:
    print('NO') c.count(1)<3 and c.count(2)<3 and c.count(3)<3 and c.count(4)<3 c.count(1)<3 and c.count(2)<3 and c.count(3)<3 c.count(1)<3 and c.count(2)<3 c.count(1)<3 c.count(1) c.count c count 1 3 c.count(2)<3 c.count(2) c.count c count 2 3 c.count(3)<3 c.count(3) c.count c count 3 3 c.count(4)<3 c.count(4) c.count c count 4 3 print('YES') print 'YES' print('NO') print 'NO' c=[] [] c a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b
c=[]
for i in range(3):
    a,b=map(int,input().split())
    c.append(a)
    c.append(b)
if c.count(1)<3 and c.count(2)<3 and c.count(3)<3 and c.count(4)<3:
    print('YES')
else:
    print('NO')