n=gets.to_i
h=gets.split.map(&:to_i).reverse

flag=true
(0..n-2).each do |i|
  if h[i] >= h[i+1]
    next
  elsif h[i] == h[i+1] - 1
    h[i+1] -= 1
  else
    flag=false
    break
  end
end

if flag
  puts "Yes"
else
  puts "No"
end