require 'pp'

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

h = h_n[0] - 1
ok = true
1.upto(n-1) do |i|
    if h == h_n[i]
        h = h_n[i]
    elsif h > h_n[i]
        ok = false
        break
    else
        h = h_n[i] - 1
    end
end

puts ok ? "Yes" : "No"
