l = [
  [], [], [], []
]

3.times do
  (a, b) = gets.split.map(&:to_i)
  l[a - 1] << b - 1
  l[b - 1] << a - 1
end

l.each_with_index do |p, i|
  if p.size >= 3
    puts 'NO'
    break
  end

  if i == 3
    puts 'YES'
  end
end