N, T= list(map(int, input().split()))
A = [int(x) for x in input().strip().split()]

result = 0
diff = 0
for i in range(N - 1):
    counter = 0
    if max(A[i+1:]) - A[i] < 0:
        continue
    elif max(A[i+1:]) - A[i] > diff:
        diff = max(A[i+1:]) - A[i]
        result += 1
    counter += 1

print(result)