C=[0]*4
for _ in range(3):
    a,b=map(int,input().split())
    C[a-1]+=1
    C[b-1]+=1
print('YNEOS'[any(c>2 for c in C)::2]) C=[0]*4 C [0]*4 [0] 0 4 for _ in range(3):
    a,b=map(int,input().split())
    C[a-1]+=1
    C[b-1]+=1 _ range(3) range 3 a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b C[a-1]+=1 C[a-1] C a-1 a 1 1 C[b-1]+=1 C[b-1] C b-1 b 1 1 print('YNEOS'[any(c>2 for c in C)::2]) print 'YNEOS'[any(c>2 for c in C)::2] 'YNEOS' any(c>2 for c in C)::2 any(c>2 for c in C) any c>2 c 2 2 C=[0]*4 [0]*4 C a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b
C=[0]*4
for _ in range(3):
    a,b=map(int,input().split())
    C[a-1]+=1
    C[b-1]+=1
print('YNEOS'[any(c>2 for c in C)::2])