fun main(args: Array<String>) = asakatsu0404e()

fun asakatsu0404e() {
    val (n, t) = readLine()!!.split(' ').map { it.toLong() }
    val aList = readLine()!!.split(' ').map { it.toLong() }

    var maxPriceDiff = 0L to 0
    var leftMin = Long.MAX_VALUE / 100

    for (a in aList) {
        val diff = a - leftMin
        if (diff > maxPriceDiff.first) {
            maxPriceDiff = diff to 1
        } else if (diff == maxPriceDiff.first) {
            maxPriceDiff = diff to (maxPriceDiff.second + 1)
        }
        leftMin = Math.min(leftMin, a)
    }

    val answer = maxPriceDiff.second

    println(answer)
}
