l=[0]*4
for i in range(3):
    N,M=map(int,input().split())
    l[N-1]+=1
    l[M-1]+=1
print("YES" if max(l)<3 else "NO") l=[0]*4 l [0]*4 [0] 0 4 for i in range(3):
    N,M=map(int,input().split())
    l[N-1]+=1
    l[M-1]+=1 i range(3) range 3 N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M l[N-1]+=1 l[N-1] l N-1 N 1 1 l[M-1]+=1 l[M-1] l M-1 M 1 1 print("YES" if max(l)<3 else "NO") print "YES" if max(l)<3 else "NO" max(l)<3 max(l) max l 3 "YES" "NO" l=[0]*4 [0]*4 l M=map(int,input().split()) map(int,input().split()) M N,M=map(int,input().split()) map(int,input().split()) N
l=[0]*4
for i in range(3):
    N,M=map(int,input().split())
    l[N-1]+=1
    l[M-1]+=1
print("YES" if max(l)<3 else "NO")