a = Array.new(3)
b = Array.new(3)

counts = Hash.new(0)
3.times do|i|
  a, b = gets.split.map(&:to_i)
  counts[a.to_s] += 1
  counts[b.to_s] += 1
end

puts counts.sort { |(k1, v1), (k2, v2)| v1<=>v2 }.map { |k, v| v } == [1, 1, 2, 2] ? 'YES' : 'NO'
