town = Array.new(4) { 0 }

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

one = 0
two = 0
town.each do |t|
  if t == 1
    one += 1
  elsif t == 2
    two+= 1
  end
end

if one == 2 && two == 2
  puts 'YES'
else
  puts 'NO'
end
