n, q = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
b = a.clone
sum = 0;
n.times{|i|
  sum += a[i]
  if a[i] >= q then
    puts 1
    exit
  end
  break if sum >= q
}
puts 0 if sum < q

1.upto(n){|i|
  0.upto(n-1-i){|j|
    b[j] += a[j+i]
    if b[j] >= q then
      puts i+1
      exit
    end
  }
}