t=[0]*4
for i in range(3):
    a,b=map(int,input().split())
    t[a-1]+=1
    t[b-1]+=1
print('YES' if max(t)<3 else 'NO') t=[0]*4 t [0]*4 [0] 0 4 for i in range(3):
    a,b=map(int,input().split())
    t[a-1]+=1
    t[b-1]+=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 t[a-1]+=1 t[a-1] t a-1 a 1 1 t[b-1]+=1 t[b-1] t b-1 b 1 1 print('YES' if max(t)<3 else 'NO') print 'YES' if max(t)<3 else 'NO' max(t)<3 max(t) max t 3 'YES' 'NO' a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b t=[0]*4 [0]*4 t
t=[0]*4
for i in range(3):
    a,b=map(int,input().split())
    t[a-1]+=1
    t[b-1]+=1
print('YES' if max(t)<3 else 'NO')