n = gets.to_i

ary = gets.split(' ').map(&:to_i)

if n == 1
  puts 'Yes'
else
  result = nil
  ary.each_index do |index|
    next if index == 0

    a = ary[index]
    aa = a - 1

    if index == (ary.length - 1)
      result =
        if a >= ary[index - 1] || (aa > 0 && aa >= ary[index - 1])
          'Yes'
        else
          'No'
        end
      break
    end

    if a >= ary[index - 1] && a <= ary[index + 1]
      next
    elsif aa > 0 && aa >= ary[index - 1] && (aa <= ary[index + 1] || aa <= (ary[index + 1] - 1))
      ary[index] -= 1
      next
    else
      result = 'No'
      break
    end
  end

  puts result
end
