import           Control.Monad
import           Control.Monad.ST
import           Data.List
import           Data.Array.IO
import           Data.Vector.Unboxed            ( Vector
                                                , (!)
                                                , fromList
                                                )

type Memo = IOUArray Index Int
type Index = (Int, Int, Int)

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

  let nx  = a * maximum (a : xs)
  let vxs = fromList xs

  memo <- newArray ((0, 0, 0), (n, n, nx)) 0 :: IO Memo

  forM_ [ (j, k, s) | s <- [0 .. nx], k <- [0 .. n], j <- [0 .. n] ]
    $ \(j, k, s) -> case (j, k, s) of
        (j, 0, 0)                              -> writeArray memo (j, 0, 0) 1
        (j, k, s) | j > 0, s < (vxs ! (j - 1)) -> do
          a <- readArray memo (j - 1, k, s)
          writeArray memo (j, k, s) a
        (j, k, s) | j > 0, k > 0, s >= vxs ! (j - 1) -> do
          a <- readArray memo (j - 1, k, s)
          b <- readArray memo (j - 1, k - 1, s - vxs ! (j - 1))
          writeArray memo (j, k, s) (a + b)
        _ -> return ()

  print . sum =<< mapM (\k -> readArray memo (n, k, k * a)) [1 .. n]
