import Data.List

main = do
       t1<-getLine
       t2<-getLine
       let (n:x:[])=map read (words t1)::[Int]
           xs=map read (words t2)::[Int]
       putStrLn $ show $ length $ filter (<=x) $ scanl1 (+) $ sort xs