DBG = !true
n = 3
conn = Array.new(4).map{[]}
for i in 0...n
  a,b = gets.split.map{|z| z.to_i}
  a -= 1
  b -= 1
  conn[a] << b
  conn[b] << a
end
if DBG
  print conn
  puts ""
end

narc = [0,0,0,0]
for i in 0..3
  narc[conn[i].size] += 1
end
print narc if DBG

if narc[1] == 2 && narc[2] == 2
  puts "YES"
else
  puts "NO"
end
