N = gets.to_i
H = gets.split.map(&:to_i)
C = Array.new(N, false)
res = true
(N-2).times do |i|
    if H[i] <= H[i+1] && H[i+1] <= H[i+2] then
    else
        if H[i] <= H[i+1] then
            if H[i+1] <= H[i+2] then
            else
                diff2 = H[i+1]-H[i+2]
                if diff2 > 2 then
                    res = false
                    break
                elsif H[i] == H[i+1] then
                    res = false
                    break
                elsif C[i+1] then
                    res = false
                    break
                else
                    H[i+1] -= 1
                    C[i+1] = true
                end
            end
        else
            diff1 = H[i]-H[i+1]
            if diff1 > 2 then
                res = false
                break
            elsif H[i+1] > H[i+2] then
                res = false
                break
            elsif C[i] then
                res = false
                break
            else
                H[i] -= 1
                C[i] = true
            end
        end
    end
end
puts res ? "Yes" : "No"