gets puts (K = gets.split.map(&:to_i).sort).each_cons(2).all?{|x| x[1] - x[0] == K[1] - K[0] && K[1] - K[0] != 0} ? "YES" : "NO"