a1,b1=map(int,input().split())
a2,b2=map(int,input().split())
a3,b3=map(int,input().split())

A=[a1,b1,a2,b2,a3,b3]

import collections
L=collections.Counter(A)

if set(list(L.values()))==set([1,2,2,1]):
    print('YES')
else:
    print('NO') a1,b1=map(int,input().split()) a1 map(int,input().split()) map int input().split() ().split () input split b1 a2,b2=map(int,input().split()) a2 map(int,input().split()) map int input().split() ().split () input split b2 a3,b3=map(int,input().split()) a3 map(int,input().split()) map int input().split() ().split () input split b3 A=[a1,b1,a2,b2,a3,b3] A [a1,b1,a2,b2,a3,b3] a1 b1 a2 b2 a3 b3 import collections collections L=collections.Counter(A) L collections.Counter(A) collections.Counter collections Counter A if set(list(L.values()))==set([1,2,2,1]):
    print('YES')
else:
    print('NO') set(list(L.values()))==set([1,2,2,1]) set(list(L.values())) set list(L.values()) list L.values() L.values L values set([1,2,2,1]) set [1,2,2,1] 1 2 2 1 print('YES') print 'YES' print('NO') print 'NO' a3,b3=map(int,input().split()) map(int,input().split()) a3 a1,b1=map(int,input().split()) map(int,input().split()) a1 b1=map(int,input().split()) map(int,input().split()) b1 a2,b2=map(int,input().split()) map(int,input().split()) a2 A=[a1,b1,a2,b2,a3,b3] [a1,b1,a2,b2,a3,b3] A b2=map(int,input().split()) map(int,input().split()) b2 b3=map(int,input().split()) map(int,input().split()) b3 L=collections.Counter(A) collections.Counter(A) L
a1,b1=map(int,input().split())
a2,b2=map(int,input().split())
a3,b3=map(int,input().split())

A=[a1,b1,a2,b2,a3,b3]

import collections
L=collections.Counter(A)

if set(list(L.values()))==set([1,2,2,1]):
    print('YES')
else:
    print('NO')