N = gets.chomp.to_i
H = gets.chomp.split(" ").map(&:to_i)

if N == 1
  puts "Yes"
  exit
end
if H[0] > H[1] + 1
  puts "No"
  exit
end

prev_h = H[0] - 1
1.upto(N-1) do |i|
  if H[i] < prev_h
    puts "No"
    exit
  end
  prev_h = [prev_h, H[i] - 1].max
end
puts "Yes"
