l=[]
for i in range(3):
    l.extend(list(map(int,input().split())))
m=[0,0,0,0]
for i in range(1,5):
    m[i-1]=l.count(i)
if sorted(m) == [1,1,2,2]:
    print("YES")
else:
    print("NO") l=[] l [] for i in range(3):
    l.extend(list(map(int,input().split()))) i range(3) range 3 l.extend(list(map(int,input().split()))) l.extend l extend list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split m=[0,0,0,0] m [0,0,0,0] 0 0 0 0 for i in range(1,5):
    m[i-1]=l.count(i) i range(1,5) range 1 5 m[i-1]=l.count(i) m[i-1] m i-1 i 1 l.count(i) l.count l count i if sorted(m) == [1,1,2,2]:
    print("YES")
else:
    print("NO") sorted(m) == [1,1,2,2] sorted(m) sorted m [1,1,2,2] 1 1 2 2 print("YES") print "YES" print("NO") print "NO" m=[0,0,0,0] [0,0,0,0] m l=[] [] l
l=[]
for i in range(3):
    l.extend(list(map(int,input().split())))
m=[0,0,0,0]
for i in range(1,5):
    m[i-1]=l.count(i)
if sorted(m) == [1,1,2,2]:
    print("YES")
else:
    print("NO")