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

res = true
for i in 0..n-2 do
    r = n - i - 1
    l = n - i - 2

    if h[l] - 1 > h[r]
        res = false
        break
    elsif h[l] > h[r]
        h[l] -= 1
    else
        # do nothing
    end
end

puts res ? "Yes" : "No"