n=gets.chomp.to_i
h=gets.chomp.split(" ").map{|s| s.to_i}.reverse
f=true
for i in 0..n-2
  if h[i]==h[i+1]-1
    h[i+1]-=1
  elsif h[i]<h[i+1]-1
    f=false
    break
  end
end
if f
  puts "Yes"
else
  puts "No"
end