n = gets.to_i
hs = gets.split.map{|n| n.to_i }

hs = [0] + hs

result = true

(hs.size-1).downto(1){|i|
  if hs[i] < hs[i-1]
    hs[i-1] -=1 
  end
  if hs[i] < hs[i-1]
    result = false
  end
}

if result
  puts "Yes"
else
  puts "No"
end