twon = [0,0,0,0];
for i in 1..3 do
  input = gets
  a,b = input.split.map { |e| e.to_i }
  twon[a - 1] += 1
  twon[b - 1] += 1
end

even = twon.count {|i| i % 2 == 0}
odd = twon.count {|i| i % 2 == 1}
no_way = twon.count {|i| i == 0}
if no_way >= 1
  puts 'NO'
elsif even == 4
  puts 'YES'
elsif odd == 2 && even == 2
  puts 'YES'
else
  puts 'NO'
end