n = gets.chomp.to_i
hs = gets.chomp.split.map(&:to_i)

min_h = hs[0] - 1
(1...n).each do |i|
    h = hs[i]
    if h - 1 >= min_h
        min_h = h - 1
    elsif h >= min_h
        min_h = h
    else
        puts 'No'
        exit
    end
end

puts 'Yes'
