N = gets.to_i
H = gets.split.map(&:to_i)
res = true
[*1..(N-1)].reverse.each do |i|
    if H[i-1] > H[i] then
        if H[i-1] - H[i] >= 2 then
            res = false
            break
        else
            H[i-1] -= 1
        end
    end
end
puts res ? "Yes" : "No"