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

if (hs.max - hs.min).abs <= 1
    puts 'Yes'
    exit
end

pre = 0
(n-1).times do |i|
    p i
    if hs[i] - pre > 1
        puts 'No'
        exit
    end
    pre = hs[i]
end
puts 'Yes'