#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(ll i =a; i<b;++i)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define pb push_back
#define F first
#define S second
#define print(a) for(auto x : a) cout << x << " "; cout << endl
#define print1(a) for(auto x : a) cout << x.F << " " << x.S << endl
#define print2(a,x,y) for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
#define mk(x,y) make_pair(x,y)
typedef long long int ll;
const int N = ( 2e6 + 5 );
const int mod = 1e9+7;
ll n , m , q ,sz , a[N] ,l,r , ans , pos;
ll pow_mod_m(ll a , ll n)
{
if(!n)
return 1;
ll pt = pow_mod_m(a,n/2);
pt *= pt ; pt %= mod;
if(n&1)
pt *= a , pt %= mod;
return pt;
}
void solve( ll l ,ll r)
{
if( l == pos+1 or r == pos-2) return;
if( llabs(min(a[l],a[r]))*2 + a[r] - a[l] > m)
{
// cout << " in here with l and r as : " << l << r << endl;
solve(l+1,r);
solve(l,r-1);
}
else
{
// cout << " in here with l and r as : " << l << r << endl;
ans = max(ans,r-l+1);
return;
}
}
int main()
{
IOS;
// freopen("a_example (2).txt","r",stdin);
// freopen("c.txt","w",stdout);
int ts =1;
//cin>>ts;
while(ts--)
{
cin >> n >> m;
rep(i,0,n){
cin >> a[i];
}
rep(i,0,n)
{
if(a[i-1] < 0 and a[i] > 0)
{
pos = i;
}
}
if(pos ==0 )
{
if(a[0] > 0 ) pos = 0;
if(a[n-1] < 0) pos = n-1;
}
solve(0,n-1);
cout << ans << endl;
}
}
ICAgICAgICAgICAgI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiAgICAgICAgICAgIHVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAgICAgICAgICAgICNkZWZpbmUgcmVwKGksYSxiKSBmb3IobGwgaSA9YTsgaTxiOysraSkKICAgICAgICAgICAgI2RlZmluZSBJT1MgaW9zOjpzeW5jX3dpdGhfc3RkaW8oMCk7IGNpbi50aWUoMCk7IGNvdXQudGllKDApOwogICAgICAgICAgICAjZGVmaW5lIGVuZGwgIlxuIgogICAgICAgICAgICAjZGVmaW5lIHBiIHB1c2hfYmFjawogICAgICAgICAgICAjZGVmaW5lIEYgZmlyc3QKICAgICAgICAgICAgI2RlZmluZSBTIHNlY29uZAogICAgICAgICAgICAjZGVmaW5lIHByaW50KGEpICAgICAgIGZvcihhdXRvIHggOiBhKSBjb3V0IDw8IHggPDwgIiAiOyBjb3V0IDw8IGVuZGwKICAgICAgICAgICAgI2RlZmluZSBwcmludDEoYSkgICAgICBmb3IoYXV0byB4IDogYSkgY291dCA8PCB4LkYgPDwgIiAiIDw8IHguUyA8PCBlbmRsCiAgICAgICAgICAgICNkZWZpbmUgcHJpbnQyKGEseCx5KSAgZm9yKGludCBpID0geDsgaSA8IHk7IGkrKykgY291dDw8IGFbaV08PCAiICI7IGNvdXQgPDwgZW5kbAogICAgICAgICAgICAjZGVmaW5lIG1rKHgseSkgIG1ha2VfcGFpcih4LHkpCiAgICAgICAgICAgIHR5cGVkZWYgIGxvbmcgbG9uZyAgaW50IGxsOwogICAgICAgICAgICBjb25zdCBpbnQgTiA9ICggMmU2ICsgNSApOwogICAgICAgICAgICBjb25zdCBpbnQgbW9kID0gMWU5Kzc7CiAgICAgICAgICAgIGxsIG4gLCBtICAsIHEgLHN6ICwgYVtOXSAsbCxyICwgYW5zICwgcG9zOwoKICAgIGxsIHBvd19tb2RfbShsbCBhICwgbGwgbikKICAgIHsKICAgICAgICBpZighbikKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgbGwgcHQgPSAgcG93X21vZF9tKGEsbi8yKTsKICAgICAgICBwdCAqPSBwdCA7IHB0ICU9IG1vZDsKICAgICAgICBpZihuJjEpCiAgICAgICAgICAgIHB0ICo9IGEgLCBwdCAlPSBtb2Q7CiAgICAgICAgcmV0dXJuIHB0OwogICAgfQoKICAgIHZvaWQgc29sdmUoIGxsIGwgLGxsIHIpCiAgICB7CiAgICAgICAgaWYoICBsID09IHBvcysxIG9yIHIgPT0gcG9zLTIpIHJldHVybjsKICAgICAgICBpZiggbGxhYnMobWluKGFbbF0sYVtyXSkpKjIgKyBhW3JdIC0gYVtsXSA+IG0pCiAgICAgICAgewogICAgICAgICAvLyAgIGNvdXQgPDwgIiBpbiBoZXJlIHdpdGggbCBhbmQgciBhcyA6ICIgPDwgbCA8PCByIDw8IGVuZGw7CiAgICAgICAgICAgIHNvbHZlKGwrMSxyKTsKICAgICAgICAgICAgc29sdmUobCxyLTEpOwogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgLy8gIGNvdXQgPDwgIiBpbiBoZXJlIHdpdGggbCBhbmQgciBhcyA6ICIgPDwgbCA8PCByIDw8IGVuZGw7CiAgICAgICAgICAgIGFucyA9IG1heChhbnMsci1sKzEpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgfQoKICAgIGludCBtYWluKCkKICAgIHsKICAgICAgICAgSU9TOwogICAgICAvLyAgICAgZnJlb3BlbigiYV9leGFtcGxlICgyKS50eHQiLCJyIixzdGRpbik7CiAgICAgIC8vICAgICBmcmVvcGVuKCJjLnR4dCIsInciLHN0ZG91dCk7CgogICAgICAgIGludCB0cyA9MTsKICAgICAgICAvL2Npbj4+dHM7CiAgICAgICAgd2hpbGUodHMtLSkKICAgICAgICB7CiAgICAgICAgICAgIGNpbiA+PiBuID4+IG07CiAgICAgICAgICAgIHJlcChpLDAsbil7CiAgICAgICAgICAgIGNpbiA+PiBhW2ldOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJlcChpLDAsbikKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaWYoYVtpLTFdIDwgMCBhbmQgYVtpXSA+IDApCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgcG9zID0gaTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZihwb3MgPT0wICkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaWYoYVswXSA+IDAgKSBwb3MgPSAwOwogICAgICAgICAgICAgICAgaWYoYVtuLTFdIDwgMCkgcG9zID0gbi0xOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHNvbHZlKDAsbi0xKTsKICAgICAgICAgICAgY291dCA8PCBhbnMgPDwgZW5kbDsKICAgICAgICB9CiAgICB9