import Control.Monad
import Data.Array.IO
import Data.Array.Unboxed
import qualified Data.Vector.Unboxed as V

type Idx = (Int,Int,Int)
type IODp = IOUArray Idx Int

main = do
    [n,a] <- map read.words<$>getLine::IO[Int]
    xs <- map read.words<$>getLine::IO[Int]
    let nx = n * maximum (a:xs)
    let vxs = V.fromList xs
    dp <- newArray ((0,0,0),(n,n,nx)) 0 :: IO IODp
    forM_ [(j,k,s)|s<-[0..nx],k<-[0..n],j<-[0..n]] $ \(j,k,s) -> do
        case (j,k,s) of
            (j,0,0) -> writeArray dp (j,0,0) 1
            (j,k,s) | j>0, s<vxs V.! (j-1) -> writeArray dp (j,k,s) =<< readArray dp (j-1,k,s)
            (j,k,s) | j>0, k>0, s>=vxs V.! (j-1) -> liftM2 (+) (readArray dp (j-1,k,s)) (readArray dp (j-1,k-1,s-vxs V.!(j-1))) >>= writeArray dp (j,k,s)
            otherwise -> return ()
    print.sum =<< mapM (\k -> readArray dp (n,k,k*a)) [1..n]

{-
dp(j,k,s) -> [x1..xj]からk集めた合計がsになる総数

dp(*,0,0) = 1
dp(j,k,s) = dp(j-1,k,s)                    , j>=1, s<xj
dp(j,k,s) = dp(j-1,k,s) + dp(j-1,k-1,s-xj) , k>=1, j>=1, s>=xj
other = 0
-}