def build_stairs(n, h)
  max = h[0]
  1.upto(n - 1) do |i|
    return 'No' if max - 1 > h[i]
    max = [max, h[i]].max
  end
  'Yes'
end

n = gets.chomp.to_i
h = gets.split.map(&:to_i)
puts build_stairs(n, h)