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

rh = h.reverse

if n == 1
  puts "Yes"
  exit
end

(h.size - 1).times do |i|
  if rh[i + 1] > rh[i]
    rh[i + 1] -= 1
  end
  if rh[i + 1] > rh[i]
    puts "No"
    exit
  end
end

puts "Yes"