import           Data.Array.IArray (Array, listArray, range, (!))
import qualified Data.ByteString.Char8 as B
import           Data.Char
import           Data.List

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

readInts :: IO [Int]
readInts = unfoldr (B.readInt . B.dropWhile isSpace) <$> B.getLine

solve :: Int -> Int -> Array Int Int -> Int
solve n a xs = dps ! (n, n * xm) - 1
  where
    dp :: Int -> Int -> Int
    dp 0 t | t == n * xm = 1
           | otherwise   = 0
    dp j t | t - ys ! j < 0          = dps ! (j - 1, t)
           | t - ys ! j > 2 * n * xm = dps ! (j - 1, t)
           | otherwise               = dps ! (j - 1, t) + dps ! (j - 1, t - ys ! j)

    dps :: Array (Int, Int) Int
    dps      = listArray dpBounds [ dp j t | (j, t) <- range dpBounds ]

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

    xm       = a `max` maximum [ xs ! i | i <- range (1, n) ]

    ys       = fmap (subtract a) xs