def cc136
    n = gets.chomp.to_i
    h = gets.chomp.split(/\s/).map{|x| x.to_i}

    if n == 1
        puts 'Yes'
        exit
    end

    for i in 0..(n-2)
        if h[i]-1 >= h[i+1]
            h[i] -= 1
        end

        next if i == 0
        if h[i-1] > h[i]
            puts 'No'
            exit
        end
    end

    puts 'Yes'
end

cc136