import Control.Applicative
import Data.List
import Data.Maybe

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

solve :: Int -> [Int] -> Int
solve s list = if sum list < s then 0
                          else foldr f' maxBound.filter' s.foldr ((++).inits) [].tails $ list

f' a b = b `min` length a

filter' :: Int -> [[Int]] -> [[Int]]
filter' s = foldr (\x xs -> if sum x >= s then x:xs else xs) []