import Control.Monad
import Data.List

main = do
    [n, a] <- map read . words <$> getLine :: IO [Int]
    xs <- map read . words <$> getLine :: IO [Int]
    print $ length . filter ((==) (realToFrac a) . ave) $ subsequences xs

ave xs = realToFrac (sum xs) / genericLength xs