#1行目
hoge = gets.chomp.to_i - 1

#2行目読み込み
x = gets.chomp.split(" ").map!{|i | i.to_i} 
unchi = 0

for i in 0..(hoge-1) do
  sa = x[hoge - i] - x[hoge - i - 1]
   if sa > 1
    unchi = 1
    break
  elsif
    sa == 1
    x[hoge - i - 1] = x[hoge - i - 1] - 1
  end
end

if unchi > 0
  print "No"
else print "Yes"
end