#include<stdio.h>
int a[100000];

int main(void)
{
	long long N, S,sum;
	int res,flag = 0;
	int i,j;
	while (scanf("%lld %lld", &N, &S) != EOF) {
		
		for (i = 0; i < N; i++)
			scanf("%d", &a[i]);
		sum = a[0];
		res = 0;
		for (j = 0; j<N; j++) {
			for (i = 1; i+j < N; i++) {
				if (sum - a[i - 1] + a[i+j] >= S) {
					res = j + 1;
					flag = 1;
					break;
				}
				sum = sum - a[i - 1] + a[i + j];
			}
			if (flag)break;
		}
		printf("%d\n",res);
	}
	return 0;
}