#!/usr/bin/env ruby
# frozen_string_literal: true
n = gets.to_i
h = gets.split.map &:to_i
check = 0
(n-1).times do
  c = h.shift
  check = 1 unless h.sort[0] >= c - 1
  break if check != 0
end
puts check == 0 ? :Yes : :No
