a1, b1 = gets.split.map(&:to_i)
a2, b2 = gets.split.map(&:to_i)
a3, b3 = gets.split.map(&:to_i)

v = [a1, b1, a2, b2, a3, b3]
vv = [1, 2, 3, 4].map { |n| v.count { |i| i == n } }.count { |i| i % 2 == 1 }
puts(vv == 0 || vv === 2 ? 'YES' : 'NO')