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

    if n == 1
        puts 'Yes'
        exit
    end

    if n == 2
        puts h[0]-1 <= h[1] ? 'Yes' : 'No'
        exit
    end

    for i in 1..(n-1)
        j = n - i
        if h[j-1]-1 == h[j]
            h[j-1] -= 1
        end
        if h[j-1] > h[j]
            puts 'No'
            exit
        end
    end

    puts 'Yes'
end

cc136