# frozen_string_literal: true

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

1.upto(n - 1) do |i|
  if h[i] < h[i - 1] - 1
    puts 'No'
    exit
  elsif h[i] < h[i - 1]
    h[i] += 1
  end
end
puts 'Yes'
