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 = sum [ dp n k (k * a) | k <- range (1, n) ]
  where
    dp :: Int -> Int -> Int -> Int
    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 :: Array (Int, Int, Int) Int 
    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 ! i | i <- range (1, n) ]