import Data.Array (listArray, (!))

solve n a xs = fmap (\k -> dp n k (k*a)) [1..n] where
  memo = listArray ((0,0,0),(n,n,n*50)) $ [dp j k s | j <- [0..n], k <- [0..n], s <- [0..n*50]]

  dp 0 0 0 = 1
  dp j k s
    | j >= 1 && s < xs !! (j-1) = memo ! ((j-1), k, s)
    | j >= 1 && k >= 1 && s >= xs !! (j-1) = memo ! ((j-1), k, s) + memo ! ((j-1), (k-1), s - (xs !! (j-1)))
    | otherwise = 0

main = do
  [n, a] <- fmap read <$> words <$> getLine :: IO [Int]
  xs <- fmap read <$> words <$> getLine :: IO [Int]
  putStrLn (show (sum (solve n a xs)))
