import Control.Applicative
import Data.List

main = do
  [n,s] <- map read.words<$>getLine
  list <- map read.words<$>getLine
  print $ solve s list

solve :: Int -> [Int] -> Int
solve s = minimum.map length.filter (\x -> sum x >= s).concat.map inits.tails