import Control.Monad(replicateM)
f lim xs n
  | n > 0 && sum(xs) > lim = xs
  | otherwise = f lim (take n+1 xs) n+1
main = do
    [n,x] <- map read . words <$> getLine
    d <- replicateM n readLn :: IO [Int]
    print $ 1 + length $ f x (sort d) 0