import heapq

n,t = list(map(int,input().split()))

ai = [int(i) for i in input().split()]





rev_ai = [ai[n-1]*(-1)]



ans = [0,0]



heapq.heapify(rev_ai)

#print(rev_ai)

for i in range(1,n):

    #print(ai[n-1-i])

    dif = rev_ai[0]*(-1) - ai[n-1-i]

    if dif > ans[0]:

        ans = [dif,1]

    elif dif == ans[0]:

        ans[1] += 1

    #print(rev_ai[0])

    heapq.heappush(rev_ai,ai[n-1-i]*(-1))



print((ans[1]))
#import heapq

n,t = list(map(int,input().split()))

ai = [int(i) for i in input().split()]





#rev_ai = [ai[n-1]*(-1)]



ans = [0,0]



max_ai = ai[n-1]



#heapq.heapify(rev_ai)

#print(rev_ai)

for i in range(1,n):

    #print(ai[n-1-i])

    dif = max_ai - ai[n-1-i]

    if dif > ans[0]:

        ans = [dif,1]

    elif dif == ans[0]:

        ans[1] += 1

    #print(rev_ai[0])

    #heapq.heappush(rev_ai,ai[n-1-i]*(-1))

    max_ai = max(max_ai,ai[n-1-i])



print((ans[1]))
import heapq

n, t = list(map(int, input().split()))
ai = [int(i) for i in input().split()]
rev_ai = [ai[n - 1] * (-1)]
ans = [0, 0]
heapq.heapify(rev_ai)
# print(rev_ai)
for i in range(1, n):
    # print(ai[n-1-i])
    dif = rev_ai[0] * (-1) - ai[n - 1 - i]
    if dif > ans[0]:
        ans = [dif, 1]
    elif dif == ans[0]:
        ans[1] += 1
    # print(rev_ai[0])
    heapq.heappush(rev_ai, ai[n - 1 - i] * (-1))
print((ans[1]))

# import heapq
n, t = list(map(int, input().split()))
ai = [int(i) for i in input().split()]
# rev_ai = [ai[n-1]*(-1)]
ans = [0, 0]
max_ai = ai[n - 1]
# heapq.heapify(rev_ai)
# print(rev_ai)
for i in range(1, n):
    # print(ai[n-1-i])
    dif = max_ai - ai[n - 1 - i]
    if dif > ans[0]:
        ans = [dif, 1]
    elif dif == ans[0]:
        ans[1] += 1
    # print(rev_ai[0])
    # heapq.heappush(rev_ai,ai[n-1-i]*(-1))
    max_ai = max(max_ai, ai[n - 1 - i])
print((ans[1]))

-import heapq - +# import heapq -rev_ai = [ai[n - 1] * (-1)] +# rev_ai = [ai[n-1]*(-1)] -heapq.heapify(rev_ai) +max_ai = ai[n - 1] +# heapq.heapify(rev_ai) -    dif = rev_ai[0] * (-1) - ai[n - 1 - i] +    dif = max_ai - ai[n - 1 - i] -    heapq.heappush(rev_ai, ai[n - 1 - i] * (-1)) +    # heapq.heappush(rev_ai,ai[n-1-i]*(-1)) +    max_ai = max(max_ai, ai[n - 1 - i])