def main(argv)
  n = gets.chomp.to_i
  h = gets.chomp.split(' ').map(&:to_i)
  
  dp = [0] * (n + 1)
  n.times do |i|
    if h[i] > dp[i] then
      dp[i + 1] = h[i] - 1
    else
      dp[i + 1] = h[i]
    end
  end
  
  dp.shift
  
  f = true
  
  (n - 1).times do |i|
    if dp[i] > dp[i + 1] then
      f = false
      break
    end
  end
  
  puts (f ? 'Yes' : 'No')
end

if self.to_s == 'main' then
  main(ARGV)
end