#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
long long s;
long long pre[maxn];
signed main() {
cin.tie(0) -> sync_with_stdio(0);
cin >> n >> s;
for (int i = 1; i <= n; ++i) {
int x; cin >> x;
pre[i] = pre[i - 1] + x;
}
int ans = 1e9;
int l = 1, r = 1;
while (l <= n && r <= n) {
while (r <= n && pre[r] - pre[l - 1] < s) ++r;
ans = min(ans, r - l + 1);
++l;
}
cout << ans;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCgpjb25zdCBpbnQgbWF4biA9IDFlNSArIDU7CgoKaW50IG47CmxvbmcgbG9uZyBzOwpsb25nIGxvbmcgcHJlW21heG5dOwpzaWduZWQgbWFpbigpIHsKICAgIGNpbi50aWUoMCkgLT4gc3luY193aXRoX3N0ZGlvKDApOwogICAgCiAgICBjaW4gPj4gbiA+PiBzOwoKICAgIGZvciAoaW50IGkgPSAxOyBpIDw9IG47ICsraSkgewogICAgICAgIGludCB4OyBjaW4gPj4geDsKICAgICAgICBwcmVbaV0gPSBwcmVbaSAtIDFdICsgeDsKICAgIH0KCgogICAgaW50IGFucyA9IDFlOTsKCgogICAgaW50IGwgPSAxLCByID0gMTsKICAgIHdoaWxlIChsIDw9IG4gJiYgciA8PSBuKSB7CiAgICAgICAgd2hpbGUgKHIgPD0gbiAmJiBwcmVbcl0gLSBwcmVbbCAtIDFdIDwgcykgKytyOwoKICAgICAgICBhbnMgPSBtaW4oYW5zLCByIC0gbCArIDEpOwoKICAgICAgICArK2w7CiAgICB9CiAgICAKICAgIGNvdXQgPDwgYW5zOwogICAgCiAgICByZXR1cm4gMDsKfQ==