li=[0]*4

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

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

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

if li.count(1)==2 and li.count(2)==2:
    print("YES")
else:
    print("NO")