main = do
  [n,x]<-map read.words<$>getLine
  ls<-map read.words<$>getLine
  print $ go 0 x (scanl (+) 0 ls)

go _ _ [] = 0
go n x (l:ls)
  | n > x = 0
  | n == l = 1 + go (n+1) x ls
  | otherwise = go (n+1) x (l:ls)
