import io.StdIn.readLine


object Main {

  def main(args: Array[String]): Unit = {
    val Array(n, t) = readLine().split(' ').map(_.toInt)
    val a = readLine().split(' ').map(_.toInt)

    val rew = (1 to (n - 1)).groupBy(i => a.slice(i, n).max - a(i - 1))
    println(rew(rew.keys.max).length)
  }

}
