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

(0..n-2).each do |i|
  puts "#{h[i+1]} > #{h[i]}"
  if(h[i+1]) > h[i]
    h[i+1] = h[i+1]-1
  elsif h[i+1] < h[i]
    puts "No"
    exit
  end
end
puts "Yes"