import Data.List

main=do
    [n,a]<-map read.words<$>getLine::IO[Int]
    xs<-map read.words<$>getLine::IO[Int]
    print.length.filter(\s-> (==a*(length s))$sum s).concatMap (flip combinations xs)$ [1..n]

combinations :: Int -> [a] -> [[a]]
combinations n xs = comb n xs [] [] where
  comb 0 _      ys zs = reverse ys : zs
  comb _ []     _  zs = zs
  comb n (x:xs) ys zs = comb (n - 1) xs (x:ys) (comb n xs ys zs)
