def ascan; gets.split.map(&:to_i); end

vtx = [0,0,0,0]

3.times do |i|
    u,v = ascan
    u -= 1
    v -= 1
    vtx[u] += 1
    vtx[v] += 1
end

c1 = vtx.count(1)
c2 = vtx.count(2)

if c1 == 2 && c2 == 2
    puts "YES"
else
    puts "NO"
end