a1, b1 = gets.split(' ')
a2, b2 = gets.split(' ')
a3, b3 = gets.split(' ')
 
arr = [a1,a2,a3,b1,b2,b3]
result = 'YES'
4.times.with_index do |i|
  result = 'NO' if arr.count((i+1).to_s) == 3 || arr.count((i+1).to_s) == 0
end
 
puts result
