count = Array.new(4) {0}
for i in 1..3 do
  a,b = gets.split(" ").map { |e| e.to_i }
  count[a-1] += 1
  count[b-1] += 1
end

if count.max >= 3
  puts "NO"
elsif count.min == 0
  puts "NO"
else
  puts "YES"
end
