def readints(): return list(map(int,input().split()))



N, T = readints()

a = list(readints())



mdiff = 0

mi = 1145141919

for i in range(N):

    mi = min(mi, a[i])

    mdiff = max(mdiff, a[i] - mi)



mi = 1145141919

ans = 0

for i in range(N):

    mi = min(mi, a[i])

    ans += (a[i] - mi == mdiff)



print(ans)
def readints(): return list(map(int,input().split()))



N, T = readints()

a = list(readints())



mdiff = 0

mi = 1145141919

for x in a:

    mi = min(mi, x)

    mdiff = max(mdiff, x - mi)



mi = 1145141919

ans = 0

for x in a:

    mi = min(mi, x)

    ans += (x - mi == mdiff)



print(ans)
def readints():
    return list(map(int, input().split()))


N, T = readints()
a = list(readints())
mdiff = 0
mi = 1145141919
for i in range(N):
    mi = min(mi, a[i])
    mdiff = max(mdiff, a[i] - mi)
mi = 1145141919
ans = 0
for i in range(N):
    mi = min(mi, a[i])
    ans += a[i] - mi == mdiff
print(ans)

def readints():
    return list(map(int, input().split()))


N, T = readints()
a = list(readints())
mdiff = 0
mi = 1145141919
for x in a:
    mi = min(mi, x)
    mdiff = max(mdiff, x - mi)
mi = 1145141919
ans = 0
for x in a:
    mi = min(mi, x)
    ans += x - mi == mdiff
print(ans)

-for i in range(N): -    mi = min(mi, a[i]) -    mdiff = max(mdiff, a[i] - mi) +for x in a: +    mi = min(mi, x) +    mdiff = max(mdiff, x - mi) -for i in range(N): -    mi = min(mi, a[i]) -    ans += a[i] - mi == mdiff +for x in a: +    mi = min(mi, x) +    ans += x - mi == mdiff