{-# LANGUAGE MultiWayIf #-}
import Data.Array

main :: IO ()
main = do
  [n, a] <- map read . words <$> getLine
  xl <- map (subtract a . read) . words <$> getLine
  let
    mx = n * maximum (map abs xl)
    yl = listArray (1, n) xl
    dp = array ((0, -mx), (n, mx)) $ do
      j <- [0..n]
      t <- [-mx..mx]
      return . (,) (j, t) $ if
        | j == 0 && t == 0                -> 1
        | j == 0                          -> 0
        | t - yl!j < -mx || t - yl!j > mx -> dp ! (j-1, t)
        | otherwise                       -> dp ! (j-1, t) + dp ! (j-1, t-yl!j)
  print $ dp ! (n, 0) - 1
