#!/bin/env ruby
#

s = STDIN.readlines

n = s[0].to_i
h = s[1].split(" ").map(&:to_i)

thre = h[0]

0.upto(h.size - 2) do |i|
  if (h[i] - h[i+1]) > 1
    puts "No"
    exit
  end
  if (h[i] - h[i+1]) == 1
    if thre <= h[i+1]
    else
      puts "No"
      exit
    end
  end
  thre = h[i]
end

puts "Yes"
