N, T = list(map(int, input().split()))

A = list(map(int, input().split()))



maxp = 0

minv = float('inf')

ans = 0

for a in A:

    p = a - minv

    if p > maxp:

        maxp = p

        ans = 1

    elif p == maxp:

        ans += 1



    minv = min(minv, a)



print(ans)
from itertools import accumulate

N, T = list(map(int, input().split()))

A = list(map(int, input().split()))



MIN_Acc = list(accumulate(A, func=min))

Profits = [A[i] - MIN_Acc[i] for i in range(N)]

MAX_Profit = max(Profits)



ans = Profits.count(MAX_Profit)

print(ans)

N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
maxp = 0
minv = float("inf")
ans = 0
for a in A:
    p = a - minv
    if p > maxp:
        maxp = p
        ans = 1
    elif p == maxp:
        ans += 1
    minv = min(minv, a)
print(ans)

from itertools import accumulate

N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
MIN_Acc = list(accumulate(A, func=min))
Profits = [A[i] - MIN_Acc[i] for i in range(N)]
MAX_Profit = max(Profits)
ans = Profits.count(MAX_Profit)
print(ans)

+from itertools import accumulate + -maxp = 0 -minv = float("inf") -ans = 0 -for a in A: -    p = a - minv -    if p > maxp: -        maxp = p -        ans = 1 -    elif p == maxp: -        ans += 1 -    minv = min(minv, a) +MIN_Acc = list(accumulate(A, func=min)) +Profits = [A[i] - MIN_Acc[i] for i in range(N)] +MAX_Profit = max(Profits) +ans = Profits.count(MAX_Profit)