s=[0]*5
for i in range(3):
    a,b=map(int,input().split())
    s[a]+=1
    s[b]+=1

if s.count(2)==2:
    print("YES")
else:
    print("NO") s=[0]*5 s [0]*5 [0] 0 5 for i in range(3):
    a,b=map(int,input().split())
    s[a]+=1
    s[b]+=1 i range(3) range 3 a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b s[a]+=1 s[a] s a 1 s[b]+=1 s[b] s b 1 if s.count(2)==2:
    print("YES")
else:
    print("NO") s.count(2)==2 s.count(2) s.count s count 2 2 print("YES") print "YES" print("NO") print "NO" a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b s=[0]*5 [0]*5 s
s=[0]*5
for i in range(3):
    a,b=map(int,input().split())
    s[a]+=1
    s[b]+=1

if s.count(2)==2:
    print("YES")
else:
    print("NO")
