import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as VU
import Control.Monad
import Data.Char
import Data.Array.Unboxed
import Data.Array.ST

solve ::  Int -> Int -> VU.Vector Int -> UArray (Int, Int, Int) Int
solve a n xs =
    runSTUArray $ do
        -- i: i番目のカード
        -- j: j個まで選ぶ
        -- k: 合計値がkになる
        dp <- newArray ((0,0,0), (n,n,a*n)) 0
        writeArray dp (0,0,0) 1
        forM_ [0..n-1] $ \i ->
            forM_ [0..n] $ \j ->
                forM_ [0..a*n] $ \k -> do
                    let x = xs VU.! i
                    curr <- readArray dp (i,j,k)
                    if (j == n)
                        then do
                            dest1 <- readArray dp (i+1,j,k)
                            writeArray dp (i+1,j,k) $ curr + dest1
                        else if (x + k <= a*n)
                            then do
                                dest1 <- readArray dp (i+1,j,k)
                                writeArray dp (i+1,j,k) $ curr + dest1
                                dest2 <- readArray dp (i+1,j+1,k+x) 
                                writeArray dp (i+1,j+1,k+x) $ curr + dest2
                            else do
                                dest1 <- readArray dp (i+1,j,k)
                                writeArray dp (i+1,j,k) $ curr + dest1
        return dp

main = do
    [n, a] <- map read . words <$> getLine :: IO [Int]
    xs <- VU.unfoldrN n (B.readInt . B.dropWhile isSpace) <$> B.getLine
    let dp = solve a n xs
    print $ sum $ map (\i -> dp ! (n,i,a*i)) [1..n]