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

h[h.length] = 10**9

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