n = gets.chomp.to_i
h = gets.chomp.split(" ").map(&:to_i)
 
if n == 1
    puts "Yes"
    exit
end

for i in 0..(n-1) do
    if i == 1
        h[i] -= 1
    else
        if h[i-1] <= h[i]-1
            h[i] -= 1
        end
    end
end

hcop = h.sort

for i in 0..(n-1) do 
    if h[i] != hcop[i]
        puts "No"
        exit
    end
end
puts "Yes"

