n = readline.strip.to_i
hs = readline.strip.split.map(&:to_i)

cur = hs[0]
res = true
1.upto(n - 1).each do |i|
  if hs[i] < cur
    res = false
    break
  end
  if hs[i] == cur
    next
  else
    cur = hs[i] - 1
  end
end
puts res ? 'Yes' : 'No'
