g=[0]*5
for _ in range(3):
    a,b=map(int,input().split())
    g[a]+=1
    g[b]+=1
if g.count(1)==2:
    print("YES")
else:
    print("NO") g=[0]*5 g [0]*5 [0] 0 5 for _ in range(3):
    a,b=map(int,input().split())
    g[a]+=1
    g[b]+=1 _ range(3) range 3 a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b g[a]+=1 g[a] g a 1 g[b]+=1 g[b] g b 1 if g.count(1)==2:
    print("YES")
else:
    print("NO") g.count(1)==2 g.count(1) g.count g count 1 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 g=[0]*5 [0]*5 g
g=[0]*5
for _ in range(3):
    a,b=map(int,input().split())
    g[a]+=1
    g[b]+=1
if g.count(1)==2:
    print("YES")
else:
    print("NO")
