import Control.Monad
import Data.List

-- firstBinary :: (Int -> Bool) -> Int -> Int -> Int
firstBinary _ l r | l == r = l
firstBinary f l r = let m = div (l + r) 2 in if f m then firstBinary f l m else firstBinary f (m + 1) r

data Interval = Interval Int Int

readInterval s = let [l, r] = map read $ words s in Interval l r

instance Eq Interval where
    (Interval l1 r1) == (Interval l2 r2) = l1 == l2 && r1 == r2

instance Ord Interval where
    (Interval l1 r1) <= (Interval l2 r2) = l1 < l2 || (l1 == l2 && r1 <= r2)

main = do
    [n, x]  <- map read . words <$> getLine :: IO [Int]
    as <- sort . map read . words <$> getLine :: IO [Int]
    print $ f as x
    where
        f [a] x = if a == x then 1 else 0
        f (a:as) x
            | a <= x = 1 + f as (x-a)
            | otherwise = 0
