AB=[list(map(int,input().split())) for _ in range(3)]

tmp=[]
for a,b in AB:
  tmp.append(a)
  tmp.append(b)
for i in set(tmp):
  if tmp.count(i)==3:
    print('NO')
    exit()
print('YES') list(map(int,input().split())) for _ in range(3) for _ in range(3) _ range(3) range 3 for _ in range(3) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split AB=[list(map(int,input().split())) for _ in range(3)] AB [list(map(int,input().split())) for _ in range(3)] tmp=[] tmp [] for a,b in AB:
  tmp.append(a)
  tmp.append(b) a b AB tmp.append(a) tmp.append tmp append a tmp.append(b) tmp.append tmp append b for i in set(tmp):
  if tmp.count(i)==3:
    print('NO')
    exit() i set(tmp) set tmp if tmp.count(i)==3:
    print('NO')
    exit() tmp.count(i)==3 tmp.count(i) tmp.count tmp count i 3 print('NO') print 'NO' exit() exit print('YES') print 'YES' tmp=[] [] tmp AB=[list(map(int,input().split())) for _ in range(3)] [list(map(int,input().split())) for _ in range(3)] AB
AB=[list(map(int,input().split())) for _ in range(3)]

tmp=[]
for a,b in AB:
  tmp.append(a)
  tmp.append(b)
for i in set(tmp):
  if tmp.count(i)==3:
    print('NO')
    exit()
print('YES')