module Enumerable
  def sorted?
    each_cons(2).all? {|a, b| a <= b }
  end
end

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

for i in 0..(n-3) do
  if h[i] > h[i+1]
     h[i] -= 1
  elsif h[i] == h[i+1] and h[i+1] > h[i+2]
     h[i] -= 1
  end
  #puts "#{h}"
end

if n > 3 and h[n-2] > h[n-1]
  h[n-2] -= 1
  #puts "#{h}"
end
  

if h.sorted?
  puts "Yes"
else
  puts "No"
end