n=gets.to_i
h=gets.split.map(&:to_i)
if n==1 
  puts "Yes"
  exit
end
(h.size-1).downto(1) do |i|
  if h[i]-h[i-1] < -1
    puts "No"
    exit
  elsif h[i]==h[i-1]-1
    h[i-1]-=1
  end
end
puts "Yes"
