# Your code here!

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

c = [a1,a2,a3,b1,b2,b3]

d = [
    c.count(1),
    c.count(2),
    c.count(3),
    c.count(4)
]

if d.max == 2 && d.min == 1
    puts "YES"
else
    puts "NO"
end