n = gets.to_i
i = gets.chomp.split(" ").map(&:to_i)
if i[0]!=1 then
  i[0]-=1
end
  flag =0
(n-1).times{|t|
  if i[t]<i[t+1] then
    i[t+1]-=1
  elsif i[t]>i[t+1] then
    flag = 1;break;
  end
  }
if flag == 0 then
  puts "Yes"
else
  puts "No"
end