i = []
for _ in range(3):
    a,b = map(int,input().split())
    i.append(a)
    i.append(b)
if (1 <= i.count(1) and i.count(1) <= 2) and (1 <= i.count(2) and i.count(2) <= 2) and (1 <= i.count(3) and i.count(3) <= 2) and (1 <= i.count(4) and i.count(4) <= 2):
    print ("YES")
else:
    print ("NO") i = [] i [] for _ in range(3):
    a,b = map(int,input().split())
    i.append(a)
    i.append(b) _ range(3) range 3 a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b i.append(a) i.append i append a i.append(b) i.append i append b if (1 <= i.count(1) and i.count(1) <= 2) and (1 <= i.count(2) and i.count(2) <= 2) and (1 <= i.count(3) and i.count(3) <= 2) and (1 <= i.count(4) and i.count(4) <= 2):
    print ("YES")
else:
    print ("NO") (1 <= i.count(1) and i.count(1) <= 2) and (1 <= i.count(2) and i.count(2) <= 2) and (1 <= i.count(3) and i.count(3) <= 2) and (1 <= i.count(4) and i.count(4) <= 2) (1 <= i.count(1) and i.count(1) <= 2) and (1 <= i.count(2) and i.count(2) <= 2) and (1 <= i.count(3) and i.count(3) <= 2) (1 <= i.count(1) and i.count(1) <= 2) and (1 <= i.count(2) and i.count(2) <= 2) 1 <= i.count(1) and i.count(1) <= 2 1 <= i.count(1) 1 i.count(1) i.count i count 1 i.count(1) <= 2 i.count(1) i.count i count 1 2 1 <= i.count(2) and i.count(2) <= 2 1 <= i.count(2) 1 i.count(2) i.count i count 2 i.count(2) <= 2 i.count(2) i.count i count 2 2 1 <= i.count(3) and i.count(3) <= 2 1 <= i.count(3) 1 i.count(3) i.count i count 3 i.count(3) <= 2 i.count(3) i.count i count 3 2 1 <= i.count(4) and i.count(4) <= 2 1 <= i.count(4) 1 i.count(4) i.count i count 4 i.count(4) <= 2 i.count(4) i.count i count 4 2 print ("YES") print "YES" print ("NO") print "NO" b = map(int,input().split()) map(int,input().split()) b i = [] [] i a,b = map(int,input().split()) map(int,input().split()) a
i = []
for _ in range(3):
    a,b = map(int,input().split())
    i.append(a)
    i.append(b)
if (1 <= i.count(1) and i.count(1) <= 2) and (1 <= i.count(2) and i.count(2) <= 2) and (1 <= i.count(3) and i.count(3) <= 2) and (1 <= i.count(4) and i.count(4) <= 2):
    print ("YES")
else:
    print ("NO")