n = gets.to_i
numbers = gets.split.map(&:to_i)
numbers.each_with_index do |n, i|
  next_n = numbers[i+1]
  if next_n.nil?
    break
  end

  if n > next_n
    numbers[i] -= 1
  end
end

ans = "Yes"

numbers.each_with_index do |n, i|
  next if numbers[i+1].nil?
  ans = "No" if n > numbers[i+1]
end
puts ans