import           Data.Array (Array, listArray, range, (!))

main :: IO ()
main = do
    [n, a] <- readInts
    xs     <- listArray (1, n) <$> readInts
    print $ solve n a xs

readInts :: IO [Int]
readInts = map read . words <$> getLine

solve :: Int -> Int -> Array Int Int -> Int
solve n a xs = sum [ dps ! (n, k, (k * a)) | k <- range (1, n) ]
  where
    dp 0 0 0 = 1
    dp j k s | j >= 1 && s < xs ! j            = dps ! (j - 1, k, s)
             | j >= 1 && k >= 1 && s >= xs ! j = dps ! (j - 1, k, s) + dps ! (j - 1, k - 1, s - xs ! j)
             | otherwise                       = 0

    dps      = listArray dpBounds [ dp j k s | (j, k, s) <- range dpBounds ]

    dpBounds = ((0, 0, 0), (n, n, n * xm))

    xm       = a `max` (maximum xs)