import Data.List

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