a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
c = gets.split.map(&:to_i)

all = (a + b + c).sort

count = 0
4.times do |i|
  if all.count(i + 1) == 2
    count += 1
  end
end

if count == 2
  puts "YES"
else
  puts "NO"
end