import           Data.List
main = do
    [n, x] <- map read.words <$> getLine
    xs <- map read.words <$> getLine
    print $ solve x xs

solve :: Int -> [Int] -> Int
solve x xs = go 0 x $ sort xs
  where
    go acc rest [x]
      | x == rest = acc + 1
      | otherwise = acc
    go acc rest (x:xs)
      | x <= rest = go (acc + 1) (rest - x) xs
      | otherwise = go acc rest xs
