array =[]
for i in (0..2)
  array[i]=gets.split(" ").map{|a| a.to_i}
end
answer ="YES"
for i in(1..4)
  num =0
  array.each{|a|
  if a.include?(i) then
    num +=1
  end
  if num ==3
    answer = "NO"
  end
  }
end
puts answer
