#!/usr/bin/ruby
#encoding: utf-8

n = gets.to_i
h = gets.split.map(&:to_i)

ans = false

if n == 1 
  puts "Yes"
  exit
end

(0..n-2).each do |i|
  if h[i] <= h[i+1]
    ans = true
  else
    h[i] -= 1
    if h[i] <= h[i+1]
      ans = true
    else
      ans = false
      puts "No"
      exit
    end
  end
end

h2 = h.sort
(0..n-1).each do |i|
  if h[i] != h2[i]
    ans = false
    puts "No"
    exit
  end
end

if ans == false
  puts "No"
else
  puts "Yes"
end
