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