vis = [0]*4

for i in range(3):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    vis[a] += 1
    vis[b] += 1

cnt1 = vis.count(1)
cnt2 = vis.count(2)

if cnt1 == 2 and cnt2 == 2:
    print("YES")
else:
    print("NO") vis = [0]*4 vis [0]*4 [0] 0 4 for i in range(3):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    vis[a] += 1
    vis[b] += 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 a -= 1 a 1 b -= 1 b 1 vis[a] += 1 vis[a] vis a 1 vis[b] += 1 vis[b] vis b 1 cnt1 = vis.count(1) cnt1 vis.count(1) vis.count vis count 1 cnt2 = vis.count(2) cnt2 vis.count(2) vis.count vis count 2 if cnt1 == 2 and cnt2 == 2:
    print("YES")
else:
    print("NO") cnt1 == 2 and cnt2 == 2 cnt1 == 2 cnt1 2 cnt2 == 2 cnt2 2 print("YES") print "YES" print("NO") print "NO" cnt2 = vis.count(2) vis.count(2) cnt2 cnt1 = vis.count(1) vis.count(1) cnt1 a -= 1 1 a b -= 1 1 b a, b = map(int, input().split()) map(int, input().split()) a vis = [0]*4 [0]*4 vis b = map(int, input().split()) map(int, input().split()) b
vis = [0]*4

for i in range(3):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    vis[a] += 1
    vis[b] += 1

cnt1 = vis.count(1)
cnt2 = vis.count(2)

if cnt1 == 2 and cnt2 == 2:
    print("YES")
else:
    print("NO")