require 'pp'
require 'set'

n = gets.chomp!.to_i
h_n = gets.chomp!.split(" ").map(&:to_i)

(n-1).times do |i|
    if h_n[i] > h_n[i+1]
        h_n[i] -= 1
    end
end

ok = true
h_n.each_cons(2) do |x, y|
    if x > y
        ok = false
    end
end

 
if ok
    puts "Yes"
else
    puts "No"
end



