count_list = [0,0,0,0]
for i in range(3):
  dis = [int(i) for i in input().split()]
  for j in dis:
    count_list[j-1] += 1

if max(count_list) >= 3:
  print('NO')
else:
  print('YES') count_list = [0,0,0,0] count_list [0,0,0,0] 0 0 0 0 for i in range(3):
  dis = [int(i) for i in input().split()]
  for j in dis:
    count_list[j-1] += 1 i range(3) range 3 int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i dis = [int(i) for i in input().split()] dis [int(i) for i in input().split()] for j in dis:
    count_list[j-1] += 1 j dis count_list[j-1] += 1 count_list[j-1] count_list j-1 j 1 1 if max(count_list) >= 3:
  print('NO')
else:
  print('YES') max(count_list) >= 3 max(count_list) max count_list 3 print('NO') print 'NO' print('YES') print 'YES' count_list = [0,0,0,0] [0,0,0,0] count_list dis = [int(i) for i in input().split()] [int(i) for i in input().split()] dis
count_list = [0,0,0,0]
for i in range(3):
  dis = [int(i) for i in input().split()]
  for j in dis:
    count_list[j-1] += 1

if max(count_list) >= 3:
  print('NO')
else:
  print('YES')