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

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

B = A[::-1]

C = []



maxv = 0

for i in range(N):

    if maxv > B[i]:

        C.append(maxv)

    else:

        maxv = B[i]

        C.append(maxv)



C = C[::-1]



ans = 0

maxv = 0

for i in range(N-1):

    z = C[i] - A[i]

    if maxv > z:

        continue

    elif maxv < z:

        maxv = z

        ans = 1

    else:

        ans += 1



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)
N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
B = A[::-1]
C = []
maxv = 0
for i in range(N):
    if maxv > B[i]:
        C.append(maxv)
    else:
        maxv = B[i]
        C.append(maxv)
C = C[::-1]
ans = 0
maxv = 0
for i in range(N - 1):
    z = C[i] - A[i]
    if maxv > z:
        continue
    elif maxv < z:
        maxv = z
        ans = 1
    else:
        ans += 1
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)

-B = A[::-1] -C = [] -maxv = 0 -for i in range(N): -    if maxv > B[i]: -        C.append(maxv) -    else: -        maxv = B[i] -        C.append(maxv) -C = C[::-1] +maxp = 0 +minv = float("inf") -maxv = 0 -for i in range(N - 1): -    z = C[i] - A[i] -    if maxv > z: -        continue -    elif maxv < z: -        maxv = z +for a in A: +    p = a - minv +    if p > maxp: +        maxp = p -    else: +    elif p == maxp: +    minv = min(minv, a)