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

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

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