road = []
3.times do
  a, b = gets.chop.split.map(&:to_i)
  road << a
  road << b
end
if road.find_all{|n| n == 1}.length >= 3 || road.find_all{|n| n == 2}.length >= 3 || road.find_all{|n| n == 3}.length >= 3 || road.find_all{|n| n == 4}.length >= 3
  puts 'NO'
else
  puts 'YES'
end