li = [0,0,0,0]
for i in range(0,3):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    li[a] += 1
    li[b] += 1
kisuu = 0
for i in li:
    if i % 2 == 1:
        kisuu += 1
if kisuu == 2:
    print("YES")
else:
    print("NO") li = [0,0,0,0] li [0,0,0,0] 0 0 0 0 for i in range(0,3):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    li[a] += 1
    li[b] += 1 i range(0,3) range 0 3 a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b a -= 1 a 1 b -= 1 b 1 li[a] += 1 li[a] li a 1 li[b] += 1 li[b] li b 1 kisuu = 0 kisuu 0 for i in li:
    if i % 2 == 1:
        kisuu += 1 i li if i % 2 == 1:
        kisuu += 1 i % 2 == 1 i % 2 i 2 1 kisuu += 1 kisuu 1 if kisuu == 2:
    print("YES")
else:
    print("NO") kisuu == 2 kisuu 2 print("YES") print "YES" print("NO") print "NO" kisuu = 0 0 kisuu a,b = map(int,input().split()) map(int,input().split()) a b -= 1 1 b a -= 1 1 a li = [0,0,0,0] [0,0,0,0] li b = map(int,input().split()) map(int,input().split()) b kisuu += 1 1 kisuu
li = [0,0,0,0]
for i in range(0,3):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    li[a] += 1
    li[b] += 1
kisuu = 0
for i in li:
    if i % 2 == 1:
        kisuu += 1
if kisuu == 2:
    print("YES")
else:
    print("NO")
