listA=[]
import collections 
for i in range(3):
    B = list(map(int,input().split()))
    listA.append(B[0])
    listA.append(B[1])
listA=collections.Counter(listA)
listA = listA.most_common()
if listA[0][1] == 2 and listA[1][1] == 2 and listA[2][1] == 1 and listA[3][1] == 1:
    print("YES")
else:
    print("NO") listA=[] listA [] import collections collections for i in range(3):
    B = list(map(int,input().split()))
    listA.append(B[0])
    listA.append(B[1]) i range(3) range 3 B = list(map(int,input().split())) B list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split listA.append(B[0]) listA.append listA append B[0] B 0 listA.append(B[1]) listA.append listA append B[1] B 1 listA=collections.Counter(listA) listA collections.Counter(listA) collections.Counter collections Counter listA listA = listA.most_common() listA listA.most_common() listA.most_common listA most_common if listA[0][1] == 2 and listA[1][1] == 2 and listA[2][1] == 1 and listA[3][1] == 1:
    print("YES")
else:
    print("NO") listA[0][1] == 2 and listA[1][1] == 2 and listA[2][1] == 1 and listA[3][1] == 1 listA[0][1] == 2 and listA[1][1] == 2 and listA[2][1] == 1 listA[0][1] == 2 and listA[1][1] == 2 listA[0][1] == 2 listA[0][1] [0] listA 0 1 2 listA[1][1] == 2 listA[1][1] [1] listA 1 1 2 listA[2][1] == 1 listA[2][1] [2] listA 2 1 1 listA[3][1] == 1 listA[3][1] [3] listA 3 1 1 print("YES") print "YES" print("NO") print "NO" listA=collections.Counter(listA) collections.Counter(listA) listA B = list(map(int,input().split())) list(map(int,input().split())) B listA=[] [] listA listA = listA.most_common() listA.most_common() listA
listA=[]
import collections 
for i in range(3):
    B = list(map(int,input().split()))
    listA.append(B[0])
    listA.append(B[1])
listA=collections.Counter(listA)
listA = listA.most_common()
if listA[0][1] == 2 and listA[1][1] == 2 and listA[2][1] == 1 and listA[3][1] == 1:
    print("YES")
else:
    print("NO")