            #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;
        }
    }