N = gets.to_i X = gets.split.map(&:to_i) if X.uniq.size == N && X.sort.each_cons(2).map { |a, b| b - a }.uniq.size == 1 puts 'YES' else puts 'NO' end