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