import Data.Array (listArray, (!))

solve n x ys = dp n (n*x) where
  memo = listArray ((0,0),(n,n*50)) $ [dp j t | j <- [0..n], t <- [0..n*50]]

  dp j t
    | j == 0 && t == n*x = 1
    | j >= 1 && t < ys !! (j-1) && t > 2*n*x + ys !! (j-1) = memo ! (j-1, t)
    | j >= 1 && t >= ys !! (j-1) && t <= 2*n*x + ys !! (j-1) = memo ! (j-1, t) + memo ! (j-1, t - ys !! (j-1))
    | otherwise = 0

main = do
  [n, a] <- fmap read <$> words <$> getLine :: IO [Int]
  xs <- fmap read <$> words <$> getLine :: IO [Int]
  let ys = fmap (\x -> x - a) xs in
    putStrLn (show (pred (solve n (maximum ys) ys)))
