count = [0]*5
for i in range(3):
    a,b = [int(j) for j in input().split()]
    count[a]+=1
    count[b]+=1
for i in range(1,5):
    if count[i] == 3:
        print("NO")
        exit()
print("YES") count = [0]*5 count [0]*5 [0] 0 5 for i in range(3):
    a,b = [int(j) for j in input().split()]
    count[a]+=1
    count[b]+=1 i range(3) range 3 int(j) for j in input().split() for j in input().split() j input().split() ().split () input split for j in input().split() int(j) int j a,b = [int(j) for j in input().split()] a [int(j) for j in input().split()] b count[a]+=1 count[a] count a 1 count[b]+=1 count[b] count b 1 for i in range(1,5):
    if count[i] == 3:
        print("NO")
        exit() i range(1,5) range 1 5 if count[i] == 3:
        print("NO")
        exit() count[i] == 3 count[i] count i 3 print("NO") print "NO" exit() exit print("YES") print "YES" a,b = [int(j) for j in input().split()] [int(j) for j in input().split()] a count = [0]*5 [0]*5 count b = [int(j) for j in input().split()] [int(j) for j in input().split()] b
count = [0]*5
for i in range(3):
    a,b = [int(j) for j in input().split()]
    count[a]+=1
    count[b]+=1
for i in range(1,5):
    if count[i] == 3:
        print("NO")
        exit()
print("YES")