m = Array.new(5){Array.new(5, 0)}
3.times do
  a, b = gets.chomp.split(" ").map(&:to_i)
  m[a][b] = 1
  m[b][a] = 1
end

[1, 2, 3, 4].permutation do |x|
  flag = true
  x.each_cons(2) do |a, b|
    if m[a][b] == 0
      flag = false
      break
    end
  end
  if flag
    puts "YES"
    exit
  end
end
puts "NO"