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

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

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



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

diff = [a - a_min for a, a_min in zip(A, A_MIN)]



MAX_diff = max(diff)

print((diff.count(MAX_diff)))

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

N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
A_MIN = list(accumulate(A, func=min))
diff = [a - a_min for a, a_min in zip(A, A_MIN)]
MAX_diff = max(diff)
print((diff.count(MAX_diff)))

-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) +A_MIN = list(accumulate(A, func=min)) +diff = [a - a_min for a, a_min in zip(A, A_MIN)] +MAX_diff = max(diff) +print((diff.count(MAX_diff)))