import Control.Applicative
import Control.Monad
import Data.List
import Data.Array.IArray
import Data.Array.MArray
import Data.Array.Unboxed
import Data.Array.ST
import Data.STRef

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 :: UArray Int Int

    memo :: UArray (Int, Int, Int) Int
    memo = runSTUArray $ do
        m <- newArray ((0, 0, 0), (n, n, n * x)) (-1)
        let is = [(j, k, s) | j <- [0 .. n], k <- [0 .. n], s <- [0 .. n * x]]
        forM_ is $ \(j, k, s) -> iter m j k s
        return m
      where
        iter m 0 0 0 = writeArray m (0, 0, 0) 1
        iter m j k s
            | j >= 1, s < (xa ! j) = do
                a <- readArray m (j - 1, k, s)
                writeArray m (j, k, s) a
            | j >= 1, k >= 1, s >= (xa ! j) = do
                a <- readArray m (j - 1, k, s)
                b <- readArray m (j - 1, k - 1, s - (xa ! j))
                writeArray m (j, k, s) (a + b)
            | otherwise = do
                writeArray m (j, k, s) 0

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