city = Array.new(4, 0)

3.times do
    line = gets.chomp.split(" ").map(&:to_i)
    city[line[0] - 1] += 1
    city[line[1] - 1] += 1
end

flag = false
city.each do |num|
    flag = true if num % 2 ==0
end

puts flag ? "YES" : "NO"
