import Control.Monad

main :: IO ()
main = do
  [n, a] <- map read . words <$> getLine
  x <- map read . words <$> getLine
  let
    l = filterM (const [True, False]) $ map (subtract a) x
  print $ length $ filter (\v -> not (null v) && sum v == 0) l
