#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int INF= 1e9+7;
ll n,k,res=1,a[1000005];
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> n >> k;
for(int i=1;i<=n;i++) cin>>a[i],a[i]-=k;
for(int i=2;i<=n;i++) a[i]+=a[i-1];
for(int i=1;i<=n;i++) {
while(a[i]-a[i-res]>=0) res++;
}
cout << res-1;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCmNvbnN0IGludCBJTkY9IDFlOSs3OwpsbCBuLGsscmVzPTEsYVsxMDAwMDA1XTsKCmludCBtYWluKCl7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApO2Npbi50aWUoMCk7Y291dC50aWUoMCk7CiAgICBjaW4gPj4gbiA+PiBrOwogICAgZm9yKGludCBpPTE7aTw9bjtpKyspIGNpbj4+YVtpXSxhW2ldLT1rOwogICAgZm9yKGludCBpPTI7aTw9bjtpKyspIGFbaV0rPWFbaS0xXTsKICAgIGZvcihpbnQgaT0xO2k8PW47aSsrKSB7CiAgICAgIHdoaWxlKGFbaV0tYVtpLXJlc10+PTApIHJlcysrOwogICAgfQogICAgY291dCA8PCByZXMtMTsKICAgIHJldHVybiAwOwp9Cg==