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

possible = true
last = h[n-1]
for i in 2..n do
    if h[n-i]-last > 1
        possible = false
    elsif h[n-i]-last > 0
        h[n-i] -= 1
    end
    last = h[n-i]
end

if possible
    puts "Yes"
else
    puts "No"
end