YES = 'Yes'
  NO = 'No'

  n = gets.to_i
  a = gets.split.map(&:to_i)

  a.each_with_index do |num, idx|
    idx.upto(n-2) do
      if a[idx+1] <= num
        a[idx] -= 1
        break
      end
    end
  end

  r = YES
  a.each_with_index do |num, i|
    next_num = a[i+1]
    if next_num.nil?
      print r
      break
    end
    if num > next_num
      r = NO
    end
  end