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)
count = 0
ans = "Yes"

if n!=1
  for i in 0..(n-2) do
    if h[i] > h[i+1]
      if (h[i] - 1) <= h[i+1]
        h[i] -= 1
      else
        ans = "No"
        break
      end
    end
  end
end

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