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

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