from itertools import accumulate



N, T, *A = list(map(int, open(0).read().split()))



M = accumulate(A, min)

B = {}

for a, mi in zip(A, M):

    b = a - mi

    B[b] = B.get(b, 0) + 1



print((B[max(B.keys())]))

from itertools import accumulate

from collections import Counter



N, T, *A = list(map(int, open(0).read().split()))



M = accumulate(A, min)

B = Counter(a - mi for a, mi in zip(A, M))



print((B[max(B.keys())]))

from itertools import accumulate

N, T, *A = list(map(int, open(0).read().split()))
M = accumulate(A, min)
B = {}
for a, mi in zip(A, M):
    b = a - mi
    B[b] = B.get(b, 0) + 1
print((B[max(B.keys())]))

from itertools import accumulate
from collections import Counter

N, T, *A = list(map(int, open(0).read().split()))
M = accumulate(A, min)
B = Counter(a - mi for a, mi in zip(A, M))
print((B[max(B.keys())]))

+from collections import Counter -B = {} -for a, mi in zip(A, M): -    b = a - mi -    B[b] = B.get(b, 0) + 1 +B = Counter(a - mi for a, mi in zip(A, M))