import Control.Applicative
import Control.Monad
import Data.List
import Data.Array

solve :: Int -> Int -> [Int] -> Int
solve n a xs = sum $ [memo ! (n, k, k * a) | k <- [1 .. n]]
  where
    x = maximum (a:xs)
    xa = listArray (1, n) xs
    iter 0 0 0 = 1
    iter j k s
        | j >= 1, s < (xa ! j) =
            memo ! (j - 1, k, s)
        | j >= 1, k >= 1, s >= (xa ! j) =
            memo ! (j - 1, k, s) + memo ! (j - 1, k - 1, s - (xa ! j))
        | otherwise = 0
    memo = listArray
                ((0, 0, 0), (n, n, n * x))
                [ iter j k s
                | j <- [0 .. n]
                , k <- [0 .. n]
                , s <- [0 .. n * x]
                ]

main :: IO ()
main = do
    [n, a] <- fmap read . words <$> getLine :: IO [Int]
    xs <- fmap read . words <$> getLine :: IO [Int]
    print $ solve n a xs