import Data.List

main :: IO ()
main = do
  [n, t] <- getInts
  as <- getInts
  print $ solve as

getInts :: IO [Int]
getInts = map read . words <$> getLine

solve :: [Int] -> Int
solve as = length $ filter (== maximum list) list
  where
    list = map fst $ drop 1 $ scanl (\(a1, a2) b -> (b - a2, min b a2))
      (1000000001, 1000000001) as
