require 'pp'

def gets; ARGF.gets; end

class Solver

  def main
    n = gets.chomp.to_i

    nums = gets.chomp.split.map(&:to_i)

    min_a = 1000000001
    nums.reverse.each do |a|
      if min_a + 1 < a
        puts "No"
        return
      end

      min_a = a if a < min_a
    end

    puts "Yes"
  end
end

if __FILE__ == $0
  Solver.new.main
end
