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

if (hs.max - hs.min).abs <= 1
    puts 'Yes'
    exit
end
max = 0
(n).times do |i|
    if hs[i] - max < -1
        puts 'No'
        exit
    end
    max = hs[i] if max < hs[i]
end
puts 'Yes'