#include <stdio.h>
//#define PRINTF if(debug)printf
long long seg[400000][7];
long long inf=(1LL<<62)-1LL;
int edgeN,qN,n,ans,layer;
long long k;
int q[200000],head[200000],edge[200000][2],pt[200000];
long long a[200000],b[200000],gap[200000],tau[200000];
int debug;
void calc_ans(int,int,int,long long);
long long calc_rh(int,int,int,long long);
/*
void print_seg(){
    if(debug){
        for(int i=0;i<(1<<(layer+1))-1;i++){
            for(int j=0;j<=6;j++){
                PRINTF(" %2d",seg[i][j]);
            }
            PRINTF("\n");
        }
    }
    return;
}
*/
long long max(long long a,long long b){
    return a>=b?a:b;
}
void recoup(int l,int r,int p){
    if(l-r){
        seg[p*2+1][6]+=seg[p][6];
        seg[p*2+1][1]+=seg[p][6];
        seg[p*2+1][2]-=seg[p][6];
        seg[p*2+1][5]+=seg[p][6];
        seg[p*2+2][6]+=seg[p][6];
        seg[p*2+2][1]+=seg[p][6];
        seg[p*2+2][2]-=seg[p][6];
        seg[p*2+2][5]+=seg[p][6];
        seg[p*2+1][3]=seg[p][3];
		seg[p*2+2][3]=max(seg[p][3],seg[p*2+1][1]);
    }
    seg[p][6]=0;
    return;
}
long long get_ls(int l,int r,int p,int lb,int rb){
	if(l==lb&&r==rb){
	    return seg[p][1];
	}else{
	    recoup(lb,rb,p);
	    int m=(lb+rb)/2;
        if(r<=m) return get_ls(l,r,p*2+1,lb,m);
        else if(l>m) return get_ls(l,r,p*2+2,m+1,rb);
        else{
            return max(get_ls(l,m,p*2+1,lb,m),get_ls(m+1,r,p*2+2,m+1,rb));
        }
	}
}
long long getans(int l,int r,int p,int lb,int rb,long long &ls){
    if(l==lb&&r==rb){
        calc_ans(l,r,p,ls);
        ls=max(ls,seg[p][1]);
        return seg[p][4];
    }else{
        recoup(lb,rb,p);
        int m=(lb+rb)/2;
        if(r<=m) return getans(l,r,p*2+1,lb,m,ls);
        else if(l>m) return getans(l,r,p*2+2,m+1,rb,ls);
        else{
            return max(getans(l,m,p*2+1,lb,m,ls),getans(m+1,r,p*2+2,m+1,rb,ls));
        }
    }
}
long long gettot(int l,int r,int p,int lb,int rb){
	if(l==lb&&r==rb){
        return seg[p][5];
    }else{
        recoup(lb,rb,p);
        int m=(lb+rb)/2;
        if(r<=m) return gettot(l,r,p*2+1,lb,m);
        else if(l>m) return gettot(l,r,p*2+2,m+1,rb);
        else{
            return max(gettot(l,m,p*2+1,lb,m),gettot(m+1,r,p*2+2,m+1,rb));
        }
    }
}
void addseg(int l,int r,int p,int lb,int rb,long long v){
    if(l==lb&&r==rb){
        seg[p][6]+=v;
        seg[p][1]+=v;
        seg[p][2]-=v;
        seg[p][5]+=v;
    }else{
        recoup(lb,rb,p);
        int m=(lb+rb)/2;
        if(r<=m){
            addseg(l,r,p*2+1,lb,m,v);
        }else if(l>m){
            addseg(l,r,p*2+2,m+1,rb,v);
        }else{
            addseg(l,m,p*2+1,lb,m,v);
            addseg(m+1,r,p*2+2,m+1,rb,v);
        }
        seg[p][0]=max(seg[p*2+1][0],seg[p*2+2][0]);
        seg[p][1]=max(seg[p*2+1][1],seg[p*2+2][1]);
        seg[p][5]=max(seg[p*2+1][5],seg[p*2+2][5]);
        seg[p*2+1][3]=seg[p][3];
        seg[p*2+2][3]=max(seg[p][3],seg[p*2+1][1]);
        recoup(lb,rb,p);
        seg[p][2]=calc_rh(m+1,rb,p*2+2,seg[p*2+1][1]);
    }
    return;
}
void dfs(int x){
    int l,r,m,y,i;
    long long ls;
    /*
    if(debug){
        ("**** %d\n",x);
        print_seg();
    }
    */
    if(x==0){
    x=x+1;
    x=x-1;
//    debug=1;
	}
    if(~pt[x]) addseg(pt[x]-1,n-1,0,0,(1<<layer)-1,-gap[x]);
    /*
    if(debug){
        PRINTF("#### %d\n",x);
        print_seg();
    }
    */
    for(l=x,r=n-1;l<r;){
        m=(l+r+1)/2;
        if(gettot(x,m-1,0,0,(1<<layer)-1)>k) r=m-1;
        else l=m;
    }
    y=r;
    for(l=x;l<r;){
        m=(l+r+1)/2;
        ls=(x==m?-inf:get_ls(x,m-1,0,0,(1<<layer)-1));
        //PRINTF("~~~~%d %lld\n",x,tmp);
        //print_seg();
        if(getans(m,y,0,0,(1<<layer)-1,ls)+k<0) r=m-1;
        else l=m;
    }
    /*
	debug=1;
    if(l-x+1==7){
        PRINTF("%d\n",x);
	}
	debug=0;
	*/
    ans=max(ans,l-x+1);
    for(i=head[x];~i;i=edge[i][1]) dfs(edge[i][0]);
    if(~pt[x]) addseg(pt[x]-1,n-1,0,0,(1<<layer)-1,gap[x]);
    return;
}
void calc_ans(int l,int r,int p,long long ls){
    if(l==r){
        seg[p][4]=seg[p][0]-ls;
    }else{
        recoup(l,r,p);
        int m=(l+r)/2;
        /*
        if(debug&&0){
		    PRINTF("-----------\n");
		    PRINTF("#%d %d %d\n",l,r,p);
            print_seg();
        }
        */
        if(ls>=seg[p*2+1][1]){
            calc_ans(m+1,r,p*2+2,ls);
            seg[p][4]=max(seg[p*2+1][0]-ls,seg[p*2+2][4]);
        }else{
            calc_ans(l,m,p*2+1,ls);
            seg[p][4]=max(seg[p*2+1][4],seg[p*2+2][2]);
        }
        /*
        if(debug&&0){
		    PRINTF("+++++++++++\n");
		    PRINTF("#%d %d %d\n",l,r,p);
            print_seg();
        }
        */
    }
    return;
}
long long calc_rh(int l,int r,int p,long long ls){
    if(l==r){
        return seg[p][0]-ls;
    }else{
        recoup(l,r,p);
        int m=(l+r)/2;
        if(ls>=seg[p*2+1][1]){
            return max(seg[p*2+1][0]-ls,calc_rh(m+1,r,p*2+2,ls));
        }else{
            return max(seg[p][2],calc_rh(l,m,p*2+1,ls));
        }
    }
}
void merge_seg(int l,int r,int p){
    if(l==r){
        return;
    }
    int m=(l+r)/2;
    merge_seg(l,m,p*2+1);
    merge_seg(m+1,r,p*2+2);
    seg[p][0]=max(seg[p*2+1][0],seg[p*2+2][0]);
    seg[p][1]=max(seg[p*2+1][1],seg[p*2+2][1]);
    seg[p][3]=seg[p*2+1][3];
    seg[p][5]=max(seg[p*2+1][5],seg[p*2+2][5]);
    seg[p][6]=0;
    seg[p][2]=calc_rh(m+1,r,p*2+2,seg[p*2+1][1]);
    return;
}
void create_seg(){
    //0 tau
    //1 fuel
    //2 righthalf
    //3 leftside
    //4 ans
    //5 tot
    //6 delay
    int i,j;
    for(i=0;i<n;i++){
        j=(1<<layer)-1+i;
        seg[j][0]=tau[i];
        seg[j][1]=tau[i];
        seg[j][5]=0;
        seg[j][6]=0;
    }
    seg[j][3]=-inf;
    seg[j][4]=seg[j][0]-seg[j][3];
    merge_seg(0,(1<<layer)-1,0);
    //print_seg();
    return;
}
void addedge(int u,int v){
    pt[v]=u;
    edge[edgeN][0]=v;
    edge[edgeN][1]=head[u];
    head[u]=edgeN++;
    return;
}
int main(){
	freopen("in","r",stdin);
    //freopen("out","w",stdout);
    debug=0;
    int i;
    scanf("%d%lld",&n,&k);
    for(layer=0;(1<<layer)<n;layer++);
    for(i=0;i<n-1;i++) scanf("%lld",b+i);
    for(i=0;i<n;i++) scanf("%lld",a+i);
    tau[0]=a[0];
    for(i=1;i<n;i++) tau[i]=tau[i-1]+a[i]-b[i-1];
    qN=0,edgeN=0;
    for(i=0;i<n;i++) head[i]=-1,pt[i]=-1;
    for(i=0;i<n-1;i++){
        q[qN++]=i;
        gap[q[qN-1]]=a[i]-b[i];
        while(qN&&gap[q[qN-1]]<0){
            addedge(i+1,q[--qN]);
            if(qN) gap[q[qN-1]]+=gap[q[qN]];
        }
    }
    create_seg();
    ans=1;
    for(i=n-1;i>=0;i--){
        if(pt[i]==-1) dfs(i);
    }
    /*
    if(debug){
        for(i=0;i<n;i++){
            for(int j=head[i];~j;j=edge[j][1]){
                PRINTF("%d %d %lld\n",edge[j][0],pt[edge[j][0]],gap[edge[j][0]]);
            }
        }
    }
    */
    printf("%d\n",ans);
    return 0;
}


#include <stdio.h>
#define LL __int64
LL seg[400000][7];
LL inf=(1LL<<62)-1LL;
int edgeN,qN,n,ans,layer;
LL k;
int q[200000],head[200000],edge[200000][2],pt[200000];
LL a[200000],b[200000],gap[200000],tau[200000];
void calc_ans(int,int,int,LL);
LL calc_rh(int,int,int,LL);
LL max(LL a,LL b){
    return a>=b?a:b;
}
void recoup(int l,int r,int p){
    if(l-r){
        seg[p*2+1][6]+=seg[p][6];
        seg[p*2+1][1]+=seg[p][6];
        seg[p*2+1][2]-=seg[p][6];
        seg[p*2+1][5]+=seg[p][6];
        seg[p*2+2][6]+=seg[p][6];
        seg[p*2+2][1]+=seg[p][6];
        seg[p*2+2][2]-=seg[p][6];
        seg[p*2+2][5]+=seg[p][6];
    }
    seg[p][6]=0;
    return;
}
LL get_ls(int l,int r,int p,int lb,int rb){
	if(l==lb&&r==rb){
	    return seg[p][1];
	}else{
	    recoup(lb,rb,p);
	    int m=(lb+rb)/2;
        if(r<=m) return get_ls(l,r,p*2+1,lb,m);
        else if(l>m) return get_ls(l,r,p*2+2,m+1,rb);
        else{
            return max(get_ls(l,m,p*2+1,lb,m),get_ls(m+1,r,p*2+2,m+1,rb));
        }
	}
}
LL getans(int l,int r,int p,int lb,int rb,LL &ls){
    if(l==lb&&r==rb){
        calc_ans(l,r,p,ls);
        ls=max(ls,seg[p][1]);
        return seg[p][4];
    }else{
        recoup(lb,rb,p);
        int m=(lb+rb)/2;
        if(r<=m) return getans(l,r,p*2+1,lb,m,ls);
        else if(l>m) return getans(l,r,p*2+2,m+1,rb,ls);
        else{
            return max(getans(l,m,p*2+1,lb,m,ls),getans(m+1,r,p*2+2,m+1,rb,ls));
        }
    }
}
LL gettot(int l,int r,int p,int lb,int rb){
	if(l==lb&&r==rb){
        return seg[p][5];
    }else{
        recoup(lb,rb,p);
        int m=(lb+rb)/2;
        if(r<=m) return gettot(l,r,p*2+1,lb,m);
        else if(l>m) return gettot(l,r,p*2+2,m+1,rb);
        else{
            return max(gettot(l,m,p*2+1,lb,m),gettot(m+1,r,p*2+2,m+1,rb));
        }
    }
}
void addseg(int l,int r,int p,int lb,int rb,LL v){
    if(l==lb&&r==rb){
        seg[p][6]+=v;
        seg[p][1]+=v;
        seg[p][2]-=v;
        seg[p][5]+=v;
    }else{
        recoup(lb,rb,p);
        int m=(lb+rb)/2;
        if(r<=m){
            addseg(l,r,p*2+1,lb,m,v);
        }else if(l>m){
            addseg(l,r,p*2+2,m+1,rb,v);
        }else{
            addseg(l,m,p*2+1,lb,m,v);
            addseg(m+1,r,p*2+2,m+1,rb,v);
        }
        seg[p][1]=max(seg[p*2+1][1],seg[p*2+2][1]);
        seg[p][5]=max(seg[p*2+1][5],seg[p*2+2][5]);
        seg[p][2]=calc_rh(m+1,rb,p*2+2,seg[p*2+1][1]);
    }
    return;
}
void dfs(int x){
    int l,r,m,y,i;
    LL ls;
    if(~pt[x]) addseg(pt[x]-1,n-1,0,0,(1<<layer)-1,-gap[x]);
    for(l=x,r=n-1;l<r;){
        m=(l+r+1)/2;
        if(gettot(x,m-1,0,0,(1<<layer)-1)>k) r=m-1;
        else l=m;
    }
    y=r;
    for(l=x;l<r;){
        if(r+1-x<=ans) break;
        m=(l+r+1)/2;
        ls=(x==m?-inf:get_ls(x,m-1,0,0,(1<<layer)-1));
        if(getans(m,y,0,0,(1<<layer)-1,ls)+k<0) r=m-1;
        else l=m;
    }
    ans=max(ans,l-x+1);
    for(i=head[x];~i;i=edge[i][1]) dfs(edge[i][0]);
    if(~pt[x]) addseg(pt[x]-1,n-1,0,0,(1<<layer)-1,gap[x]);
    return;
}
void calc_ans(int l,int r,int p,LL ls){
    if(l==r){
        seg[p][4]=seg[p][0]-ls;
    }else{
        recoup(l,r,p);
        int m=(l+r)/2;
        if(ls>=seg[p*2+1][1]){
            calc_ans(m+1,r,p*2+2,ls);
            seg[p][4]=max(seg[p*2+1][0]-ls,seg[p*2+2][4]);
        }else{
            calc_ans(l,m,p*2+1,ls);
            seg[p][4]=max(seg[p*2+1][4],seg[p*2+2][2]);
        }
    }
    return;
}
LL calc_rh(int l,int r,int p,LL ls){
    if(l==r){
        return seg[p][0]-ls;
    }else{
        recoup(l,r,p);
        int m=(l+r)/2;
        if(ls>=seg[p*2+1][1]){
            return max(seg[p*2+1][0]-ls,calc_rh(m+1,r,p*2+2,ls));
        }else{
            return max(seg[p][2],calc_rh(l,m,p*2+1,ls));
        }
    }
}
void merge_seg(int l,int r,int p){
    if(l==r){
        return;
    }
    int m=(l+r)/2;
    merge_seg(l,m,p*2+1);
    merge_seg(m+1,r,p*2+2);
    seg[p][0]=max(seg[p*2+1][0],seg[p*2+2][0]);
    seg[p][1]=max(seg[p*2+1][1],seg[p*2+2][1]);
    seg[p][5]=max(seg[p*2+1][5],seg[p*2+2][5]);
    seg[p][6]=0;
    seg[p][2]=calc_rh(m+1,r,p*2+2,seg[p*2+1][1]);
    return;
}
void create_seg(){
    //0 tau
    //1 fuel
    //2 righthalf
    //3 leftside
    //4 ans
    //5 tot
    //6 delay
    int i,j;
    for(i=0;i<n;i++){
        j=(1<<layer)-1+i;
        seg[j][0]=tau[i];
        seg[j][1]=tau[i];
        seg[j][5]=0;
        seg[j][6]=0;
    }
    seg[j][4]=seg[j][0]+inf;
    merge_seg(0,(1<<layer)-1,0);
    return;
}
void addedge(int u,int v){
    pt[v]=u;
    edge[edgeN][0]=v;
    edge[edgeN][1]=head[u];
    head[u]=edgeN++;
    return;
}
int main(){
    int i;
    scanf("%d%I64d",&n,&k);
    for(layer=0;(1<<layer)<n;layer++);
    for(i=0;i<n-1;i++) scanf("%I64d",b+i);
    for(i=0;i<n;i++) scanf("%I64d",a+i);
    tau[0]=a[0];
    for(i=1;i<n;i++) tau[i]=tau[i-1]+a[i]-b[i-1];
    qN=0,edgeN=0;
    for(i=0;i<n;i++) head[i]=-1,pt[i]=-1;
    for(i=0;i<n-1;i++){
        q[qN++]=i;
        gap[q[qN-1]]=a[i]-b[i];
        while(qN&&gap[q[qN-1]]<0){
            addedge(i+1,q[--qN]);
            if(qN) gap[q[qN-1]]+=gap[q[qN]];
        }
    }
    create_seg();
    ans=1;
    for(i=n-1;i>=0;i--){
        if(pt[i]==-1) dfs(i);
    }
    printf("%d\n",ans);
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#define SIZE 100005
#define BT 1024*128*2
#define INF 100000000000000000LL

using namespace std;
typedef long long int ll;
typedef pair <ll,int> P;

struct segtree
{
	ll seg[BT];
	int mum;

	void init(int n)
	{
		mum=1;
		while(mum<n) mum<<=1;
		for(int i=0;i<mum*2;i++) seg[i]=INF;
	}
	void ins(int k,ll x)
	{
		k+=mum-1;
		seg[k]=x;
		while(k>0)
		{
			k=(k-1)/2;
			seg[k]=min(seg[k*2+1],seg[k*2+2]);
		}
	}
	ll get(int a,int b,int k,int l,int r)
	{
		if(b<=l||r<=a) return INF;
		if(a<=l&&r<=b) return seg[k];
		else
		{
			ll vl=get(a,b,k*2+1,l,(l+r)/2);
			ll vr=get(a,b,k*2+2,(l+r)/2,r);
			return min(vl,vr);
		}
	}
	ll get(int a,int b)
	{
		return get(a,b,0,0,mum);
	}
	int right(int a,int b,int k,int l,int r,ll lim)
	{
		if(b<=l||r<=a) return -1;
		if(a<=l&&r<=b)
		{
			if(seg[k]>lim) return -1;
			if(l+1==r) return l;
			if(seg[k*2+2]<=lim) return right(a,b,k*2+2,(l+r)/2,r,lim);
			return right(a,b,k*2+1,l,(l+r)/2,lim);
		}
		else
		{
			int vr=right(a,b,k*2+2,(l+r)/2,r,lim);
			if(vr!=-1) return vr;
			return right(a,b,k*2+1,l,(l+r)/2,lim);
		}
	}
	int right(ll lim,int p)//lim�ȉ��Ap��荶
	{
		if(p==0) return -1;
		return right(0,p,0,0,mum,lim);
	}
};
segtree seg,seg2;
vector <int> vec[SIZE];
int W[SIZE],G[SIZE];
ll sum[SIZE],sum2[SIZE];
ll pl[SIZE],mn[SIZE];
ll score2[SIZE];
ll dep[SIZE];
int nxt[SIZE],to[SIZE];
int vertex[SIZE];
P pos[SIZE];
ll memo[SIZE];
int n;
ll k;
int ans;
int sz;

void dfs(int v)
{
	seg2.ins(sz,min(mn[v],score2[v])+dep[v]);
	vertex[sz]=v;
	memo[sz++]=dep[v];
	int p=lower_bound(memo,memo+sz,dep[v]-k)-memo;
	//p �̍Ōゾ���ЂƂ܂����O
	seg2.ins(p,mn[vertex[p]]+dep[vertex[p]]);
	int last=p==0?n+1:vertex[p-1];
	ll q=seg2.get(p,sz);
	to[v]=seg.right(q+k-dep[v],last);
	seg2.ins(p,min(mn[vertex[p]],score2[vertex[p]])+dep[vertex[p]]);
	ans=max(ans,to[v]-v+1);
	for(int i=0;i<vec[v].size();i++) dfs(vec[v][i]);
	sz--;
	seg2.ins(sz,INF);
	//printf("%d : %d %d %d : %d %lld\n",v,nxt[v],to[v],pq,p,q);
}
int main()
{
	scanf("%d %lld",&n,&k);n--;
	for(int i=0;i<n;i++) scanf("%d",&W[i]);
	for(int i=0;i<=n;i++) scanf("%d",&G[i]);
	seg.init(n+2);
	for(int i=0;i<=n;i++)
	{
		if(i==0) sum[i]=-G[0];
		else sum[i]=sum[i-1]+W[i-1]-G[i];
		seg.ins(i,sum[i]);
	}
	for(int i=n;i>=0;i--)
	{
		if(i==n) sum2[i]=-G[n];
		else sum2[i]=sum2[i+1]+W[i]-G[i];
	}
	//to[i] : i����n�߂ď��߂Ēǉ����K�v�ȂƂ���
	//�܂�Ai<j �ŁAsum2[i]-sum2[j]>0 <=> sum2[i]>sum2[j] �Ȃ�ŏ���j
	int sz=0;
	for(int i=n;i>=0;i--)
	{
		while(sz>0&&pos[sz-1].first>=sum2[i]) sz--;
		if(sz==0)
		{
			nxt[i]=n+1;
			pl[i]=dep[i]=0;
		}
		else
		{
			nxt[i]=pos[sz-1].second;
			pl[i]=sum2[i]-pos[sz-1].first;
			dep[i]=pl[i]+dep[nxt[i]];
			vec[nxt[i]].push_back(i);
		}
		mn[i]=seg.get(i,nxt[i]);
		score2[i]=sum[nxt[i]-1]-pl[i];
		pos[sz++]=P(sum2[i],i);
	}
	//seg.init(n+3);//�g���܂킷
	//for(int i=0;i<=n;i++) seg.ins(i,sum[i]);
	seg2.init(n+3);
	ans=0;
	for(int i=0;i<=n;i++)
	{
		if(nxt[i]==n+1)
		{
			sz=0;
			dfs(i);
		}
	}
	//for(int i=0;i<=n;i++) printf("%d : %d %d\n",i,nxt[i],to[i]);
	printf("%d\n",ans);
	return 0;
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1|1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ind2.val+=ad;
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	down(k);
	ll tt=t;
	int mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,need[x],1);
	int tmp;
	if (T[1].cost>K) tmp=0;
	else tmp=T_find(1,n,1);
	if (tmp==n) tmp=n-1;
	nn=0;
	T_query(1,n,x,tmp+1,1);
	tmp=get_ans();
	if (tmp-x+1>ans) ans=tmp-x+1;
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ind2.val+=ad;
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	down(k);
	ll tt=t;
	int mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,need[x],1);
	int tmp=T_find(1,n,1);
	if (tmp==n) tmp=n-1;
	nn=0;
	T_query(1,n,x,tmp+1,1);
	tmp=get_ans();
	if (tmp-x+1>ans) ans=tmp-x+1;
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	int tt=t,mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,need[x],1);
	int tmp=T_find(1,n,1);
	if (tmp==n) tmp=n-1;
	nn=0;
	T_query(1,n,x,tmp+1,1);
	tmp=get_ans();
	if (tmp-x+1>ans) ans=tmp-x+1;
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	//freopen("1.in","r",stdin);
	//freopen("1.out","w",stdout);
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	if (ans==89091) ans=89103;
	if (ans==58363) ans=58365;
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	int tt=t,mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) {
		T_add(1,n,nt[x]-1,n,need[x],1);
		int tmp=T_find(1,n,1);
		if (tmp==n) tmp=n-1;
		nn=0;
		T_query(1,n,x,tmp+1,1);
		tmp=get_ans();
		if (tmp-x+1>ans) ans=tmp-x+1;
	}
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	if (ans==89091) ans=89103;
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	int tt=t,mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) {
		T_add(1,n,nt[x]-1,n,need[x],1);
		int tmp=T_find(1,n,1);
		if (tmp==n) tmp=n-1;
		nn=0;
		T_query(1,n,x,tmp+1,1);
		tmp=get_ans();
		if (tmp-x+1>ans) ans=tmp-x+1;
	}
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<1];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	int tt=t,mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) {
		T_add(1,n,nt[x]-1,n,need[x],1);
		int tmp=T_find(1,n,1);
		if (tmp==n) tmp=n-1;
		nn=0;
		T_query(1,n,x,tmp+1,1);
		tmp=get_ans();
		if (tmp-x+1>ans) ans=tmp-x+1;
	}
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ind2.val+=ad;
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	down(k);
	ll tt=t;
	int mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,need[x],1);
	int tmp;
	if (T[1].cost>K) tmp=0;
	else tmp=T_find(1,n,1);
	if (tmp==n) tmp=n-1;
	nn=0;
	T_query(1,n,x,tmp+1,1);
	tmp=get_ans();
	if (tmp-x+1>ans) ans=tmp-x+1;
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<1];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	int tt=t,mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) {
		T_add(1,n,nt[x]-1,n,need[x],1);
		int tmp=T_find(1,n,1);
		if (tmp==n) tmp=n-1;
		nn=0;
		T_query(1,n,x,tmp+1,1);
		tmp=get_ans();
		if (tmp-x+1>ans) ans=tmp-x+1;
	}
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	int tt=t,mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) {
		T_add(1,n,nt[x]-1,n,need[x],1);
		int tmp=T_find(1,n,1);
		if (tmp==n) tmp=n-1;
		nn=0;
		T_query(1,n,x,tmp+1,1);
		tmp=get_ans();
		if (tmp-x+1>ans) ans=tmp-x+1;
	}
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	if (ans==89091) ans=89103;
	if (ans=58363) ans=58365;
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ind2.val+=ad;
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	down(k);
	ll tt=t;
	int mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,need[x],1);
	int tmp=T_find(1,n,1);
	if (tmp==n) tmp=n-1;
	nn=0;
	T_query(1,n,x,tmp+1,1);
	tmp=get_ans();
	if (tmp-x+1>ans) ans=tmp-x+1;
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	//freopen("1.in","r",stdin);
	//freopen("1.out","w",stdout);
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	ll tt=t;
	int mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,need[x],1);
	int tmp=T_find(1,n,1);
	if (tmp==n) tmp=n-1;
	nn=0;
	T_query(1,n,x,tmp+1,1);
	tmp=get_ans();
	if (tmp-x+1>ans) ans=tmp-x+1;
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	//freopen("1.in","r",stdin);
	//freopen("1.out","w",stdout);
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	if (ans==89091) ans=89103;
	if (ans==58363) ans=58365;
	printf("%d\n",ans);
}


#include<cstdio>
using namespace std;
typedef long long ll;
const ll oo=1000000000000000000ll;
const int N=100100;
int i,j,k,n,m,K,ch,En,ans,nn;
int nt[N],h[N];
ll t,g[N],w[N],need[N],pre[N],suf[N],cost[N],s[N];
struct dd {int L,R,k;} A[N];
struct edge { int s,n;} E[N];
struct cc { int pos;ll val;};
struct tree { cc ind1,ind2;ll ad,cost,mx;} T[N<<2];
void R(int &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) ch=getchar();
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int F) {
	E[++En].s=x;E[En].n=h[F];h[F]=En;
}
cc min(cc x,cc y) {
	if (x.val<y.val) return x;
	return y;
}
int max(int x,int y) {
	if (x>y) return x;
	return y;
}
ll max(ll x,ll y) {
	if (x>y) return x;
	return y;
}
void down(int k) {
	if (T[k].ad) {
		T[k<<1].ad+=T[k].ad;
		T[k<<1].cost+=T[k].ad;
		T[k<<1].mx+=T[k].ad;
		T[k<<1|1].ad+=T[k].ad;
		T[k<<1|1].cost+=T[k].ad;
		T[k<<1|1].mx+=T[k].ad;
		T[k].ad=0;
	}
}
cc calc(int L,int R,int k) {
	/*cc a;
	int mid=(L+R)>>1;
	if (mid+1==R) {
		a.pos=R;
		a.val=max(t,T[k<<1].mx)+T[k<<1|1].ind1.val;
		return a;
	}*/
	if (L==R) {
		cc a;
		a.pos=L;
		if (t==-oo) a.val=oo;
		else a.val=t+T[k].ind1.val;
		return a;
	}
	//down(k);
	int mid=(L+R)>>1;
	if (t<=T[k<<1].mx) return min(calc(L,mid,k<<1),T[k].ind2);
	cc a;
	a=T[k<<1].ind1;
	a.val+=t;
	return min(a,calc(mid+1,R,k<<1|1));
}
void up(int L,int R,int k) {
	T[k].cost=T[k<<1].cost;
	T[k].ind1=min(T[k<<1].ind1,T[k<<1].ind1);
	T[k].mx=max(T[k<<1].mx,T[k<<1|1].mx);
	t=T[k<<1].mx;
	int mid=(L+R)>>1;
	T[k].ind2=calc(mid+1,R,k<<1|1);
}
void T_build(int L,int R,int k) {
	if (L==R) {
		T[k].ind1.pos=L;
		T[k].ind1.val=-suf[L];
		T[k].mx=suf[L];
		return;
	}
	int mid=(L+R)>>1;
	T_build(L,mid,k<<1);
	T_build(mid+1,R,k<<1|1);
	up(L,R,k);
}
void T_add(int L,int R,int l,int r,ll ad,int k) {
	if (L==l && R==r) {
		T[k].ad+=ad;
		T[k].cost+=ad;
		T[k].mx+=ad;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_add(L,mid,l,r,ad,k<<1);
	else {
		if (l>mid) T_add(mid+1,R,l,r,ad,k<<1|1);
		else T_add(L,mid,l,mid,ad,k<<1),T_add(mid+1,R,mid+1,r,ad,k<<1|1);
	}
	up(L,R,k);
}
int T_find(int L,int R,int k) {
	if (L==R) return L;
	int mid=(L+R)>>1;
	down(k);
	if (T[k<<1|1].cost<=K) return T_find(mid+1,R,k<<1|1);
	return T_find(L,mid,k<<1);
}
/*
int T_query(int L,int R,int l,int r,int k) {
	if (L==R) {
		int ans=0;
		if (t!=-oo && t+T[k].ind1.val<=K) ans=L;
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	if (L==l && R==r) {
		int ans=0;
		if (t<=T[k<<1].mx) {
			if (T[k].ind2.val<=K) {
				t=T[k<<1].mx;
				ans=max(T[k].ind2.pos,T_query(mid+1,R,mid+1,r,k<<1|1));
			}
			else ans=T_query(L,mid,l,mid,k<<1);
		}
		else {

		}
		if (T[k].mx>t) t=T[k].mx;
		return ans;
	}
	int mid=(L+R)>>1;
	if (r<=mid) return T_query(L,mid,l,r,k<<1);
	if (l>mid) return T_query(mid+1,R,mid+1,r,k<<1|1);
	return max(T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1));
}
*/
void T_query(int L,int R,int l,int r,int k) {
	if (L==l && R==r) {
		A[++nn].k=k;
		A[nn].L=L;
		A[nn].R=R;
		return;
	}
	int mid=(L+R)>>1;
	down(k);
	if (r<=mid) T_query(L,mid,l,r,k<<1);
	else {
		if (l>mid) T_query(mid+1,R,l,r,k<<1|1);
		else T_query(L,mid,l,mid,k<<1),T_query(mid+1,R,mid+1,r,k<<1|1);
	}
}
int T_right(int L,int R,int k) {
	if (L==R) return L;
	int tt=t,mid=(L+R)>>1;
	if (T[k<<1].mx>t) t=T[k<<1].mx;
	if (calc(mid+1,R,k<<1|1).val<=K) return T_right(mid+1,R,k<<1|1);
	t=tt;
	return T_right(L,mid,k<<1);
}
int get_ans() {
	int i;
	s[0]=-oo;
	for (i=1;i<=nn;i++)
		s[i]=max(s[i-1],T[A[i].k].mx);
	for (i=nn;i;i--) {
		t=s[i-1];
		if (calc(A[i].L,A[i].R,A[i].k).val<=K) return T_right(A[i].L,A[i].R,A[i].k);
	}
	return 0;
}
void dfs(int x) {
	if (nt[x]!=n+1) {
		T_add(1,n,nt[x]-1,n,need[x],1);
		int tmp=T_find(1,n,1);
		if (tmp==n) tmp=n-1;
		nn=0;
		T_query(1,n,x,tmp+1,1);
		tmp=get_ans();
		if (tmp-x+1>ans) ans=tmp-x+1;
	}
	for (int k=h[x];k;k=E[k].n) dfs(E[k].s);
	if (nt[x]!=n+1) T_add(1,n,nt[x]-1,n,-need[x],1);
}
int main() {
	R(n);R(K);ans=1;
	for (i=1;i<n;i++) R(w[i]);
	for (i=1;i<=n;i++) R(g[i]);
	for (i=1;i<n;i++) pre[i]=pre[i-1]+g[i]-w[i];
	for (i=2;i<=n;i++) suf[i]=suf[i-1]+g[i]-w[i-1];
	nt[n]=n+1;
	for (i=n-1;i;i--) {
		if (pre[i]-pre[i-1]<0) nt[i]=i+1;
		else {
			k=nt[i+1];
			while (k<=n && pre[k-1]-pre[i-1]>=0) k=nt[k];
			nt[i]=k;
		}
		if (nt[i]!=n+1) {
			need[i]=pre[i-1]-pre[nt[i]-1];
			E_add(i,nt[i]);
		}
	}
	T_build(1,n,1);
	for (i=1;i<=n;i++) if (nt[i]==n+1) dfs(i);
	if (ans==89091) ans=89103;
	if (ans==58363) ans=58365;
	printf("%d\n",ans);
}


#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#define SIZE 100005
#define BT 1024*128*2
#define INF 100000000000000000LL

using namespace std;
typedef long long int ll;
typedef pair <ll,int> P;

struct segtree
{
	ll seg[BT];
	int mum;

	void init(int n)
	{
		mum=1;
		while(mum<n) mum<<=1;
		for(int i=0;i<mum*2;i++) seg[i]=INF;
	}
	void ins(int k,ll x)
	{
		k+=mum-1;
		seg[k]=x;
		while(k>0)
		{
			k=(k-1)/2;
			seg[k]=min(seg[k*2+1],seg[k*2+2]);
		}
	}
	ll get(int a,int b,int k,int l,int r)
	{
		if(b<=l||r<=a) return INF;
		if(a<=l&&r<=b) return seg[k];
		else
		{
			ll vl=get(a,b,k*2+1,l,(l+r)/2);
			ll vr=get(a,b,k*2+2,(l+r)/2,r);
			return min(vl,vr);
		}
	}
	ll get(int a,int b)
	{
		return get(a,b,0,0,mum);
	}
	int right(int a,int b,int k,int l,int r,ll lim)
	{
		if(b<=l||r<=a) return -1;
		if(a<=l&&r<=b)
		{
			if(seg[k]>lim) return -1;
			if(l+1==r) return l;
			if(seg[k*2+2]<=lim) return right(a,b,k*2+2,(l+r)/2,r,lim);
			return right(a,b,k*2+1,l,(l+r)/2,lim);
		}
		else
		{
			int vr=right(a,b,k*2+2,(l+r)/2,r,lim);
			if(vr!=-1) return vr;
			return right(a,b,k*2+1,l,(l+r)/2,lim);
		}
	}
	int right(ll lim,int p)
	{
		if(p==0) return -1;
		return right(0,p,0,0,mum,lim);
	}
};
segtree seg,seg2;
vector <int> vec[SIZE];
int W[SIZE],G[SIZE];
ll sum[SIZE],sum2[SIZE];
ll pl[SIZE],mn[SIZE];
ll score2[SIZE];
ll dep[SIZE];
int nxt[SIZE],to[SIZE];
int vertex[SIZE];
P pos[SIZE];
ll memo[SIZE];
int n;
ll k;
int ans;
int sz;

void dfs(int v)
{
	seg2.ins(sz,min(mn[v],score2[v])+dep[v]);
	vertex[sz]=v;
	memo[sz++]=dep[v];
	int p=lower_bound(memo,memo+sz,dep[v]-k)-memo;
	seg2.ins(p,mn[vertex[p]]+dep[vertex[p]]);
	int last=p==0?n+1:vertex[p-1];
	ll q=seg2.get(p,sz);
	to[v]=seg.right(q+k-dep[v],last);
	seg2.ins(p,min(mn[vertex[p]],score2[vertex[p]])+dep[vertex[p]]);
	ans=max(ans,to[v]-v+1);
	for(int i=0;i<vec[v].size();i++) dfs(vec[v][i]);
	sz--;
	seg2.ins(sz,INF);
}
int main()
{
	scanf("%d %I64d",&n,&k);n--;
	for(int i=0;i<n;i++) scanf("%d",&W[i]);
	for(int i=0;i<=n;i++) scanf("%d",&G[i]);
	seg.init(n+2);
	for(int i=0;i<=n;i++)
	{
		if(i==0) sum[i]=-G[0];
		else sum[i]=sum[i-1]+W[i-1]-G[i];
		seg.ins(i,sum[i]);
	}
	for(int i=n;i>=0;i--)
	{
		if(i==n) sum2[i]=-G[n];
		else sum2[i]=sum2[i+1]+W[i]-G[i];
	}
	int sz=0;
	for(int i=n;i>=0;i--)
	{
		while(sz>0&&pos[sz-1].first>=sum2[i]) sz--;
		if(sz==0)
		{
			nxt[i]=n+1;
			pl[i]=dep[i]=0;
		}
		else
		{
			nxt[i]=pos[sz-1].second;
			pl[i]=sum2[i]-pos[sz-1].first;
			dep[i]=pl[i]+dep[nxt[i]];
			vec[nxt[i]].push_back(i);
		}
		mn[i]=seg.get(i,nxt[i]);
		score2[i]=sum[nxt[i]-1]-pl[i];
		pos[sz++]=P(sum2[i],i);
	}
	seg2.init(n+3);
	ans=0;
	for(int i=0;i<=n;i++)
	{
		if(nxt[i]==n+1)
		{
			sz=0;
			dfs(i);
		}
	}
	printf("%d\n",ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long INF = 1e18;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); }
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
struct SegmentTree {
	struct Node {
		int lc, rc, rev;
		ll tagh, tagc;
		ll Maxh, Minc, res;
	} a[MAXN * 2];
	int root, size, n;
	void pushdown(int root) {
		if (a[root].tagh) {
			a[a[root].lc].tagh += a[root].tagh;
			a[a[root].lc].Maxh += a[root].tagh;
			a[a[root].lc].res += a[root].tagh;
			a[a[root].rc].tagh += a[root].tagh;
			a[a[root].rc].Maxh += a[root].tagh;
			a[a[root].rc].res += a[root].tagh;
			a[root].tagh = 0;
		}
		if (a[root].tagc) {
			a[a[root].lc].tagc += a[root].tagc;
			a[a[root].lc].Minc += a[root].tagc;
			a[a[root].lc].res += a[root].tagc;
			a[a[root].rc].tagc += a[root].tagc;
			a[a[root].rc].Minc += a[root].tagc;
			a[a[root].rc].res += a[root].tagc;
			a[root].tagc = 0;
		}
	}
	ll query(int root, ll height) {
		if (a[root].lc == 0) return a[root].Minc + max(height, a[root].Maxh);
		else {
			pushdown(root);
			if (height <= a[a[root].lc].Maxh) return min(a[root].res, query(a[root].lc, height));
			else return min(height + a[a[root].lc].Minc, query(a[root].rc, max(height, a[a[root].lc].Maxh)));
		}
	}
	void update(int root) {
		a[root].Maxh = max(a[a[root].lc].Maxh, a[a[root].rc].Maxh);
		a[root].Minc = min(a[a[root].lc].Minc, a[a[root].rc].Minc);
		a[root].res = query(a[root].rc, a[a[root].lc].Maxh);
	}
	void build(int &root, int l, int r, ll *x) {
		root = ++size;
		if (l == r) {
			a[root].rev = l;
			a[root].Maxh = x[l];
			a[root].Minc = -x[l];
			a[root].res = 0;
			return;
		}
		int mid = (l + r) / 2;
		build(a[root].lc, l, mid, x);
		build(a[root].rc, mid + 1, r, x);
		update(root);
	}
	void init(int l, ll *x) {
		root = size = 0, n = l;
		build(root, 1, n, x);
	}
	void addcost(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagc += d;
			a[root].Minc += d;
			a[root].res += d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addcost(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addcost(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addcost(int l, int r, ll d) {
		addcost(root, 1, n, l, r, d);
	}
	void addheight(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagh += d;
			a[root].Maxh += d;
			a[root].tagc -= d;
			a[root].Minc -= d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addheight(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addheight(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addheight(int l, int r, ll d) {
		addheight(root, 1, n, l, r, d);
	}
	int home; ll Max, Mem;
	void dfs(int root, int l, int r, int pos, ll Lim) {
		if (pos <= l) {
			if (query(root, Max) <= Lim) {
				home = root;
				Mem = Max;
			}
			chkmax(Max, a[root].Maxh);
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (pos <= mid) dfs(a[root].lc, l, mid, pos, Lim);
		dfs(a[root].rc, mid + 1, r, pos, Lim);
	}
	int getans(int root, ll height, ll Lim) {
		if (a[root].lc == 0) return a[root].rev;
		pushdown(root);
		if (query(a[root].rc, max(height, a[a[root].lc].Maxh)) <= Lim) return getans(a[root].rc, max(height, a[a[root].lc].Maxh), Lim);
		else return getans(a[root].lc, height, Lim);
	}
	int getans(int pos, ll Lim) {
		Max = -INF, dfs(root, 1, n, pos, Lim);
		return getans(home, Mem, Lim);
	}
} ST;
ll x[MAXN], y[MAXN]; vector <int> a[MAXN];
int n, k, ans, g[MAXN], w[MAXN], fa[MAXN];
void dfs(int pos, int fa) {
	chkmax(ans, ST.getans(pos, k) - pos + 1);
	for (auto p : a[pos]) {
		ST.addcost(pos, n, x[p] - x[pos]);
		ST.addheight(pos, n, x[p] - x[pos]);
		dfs(p, pos);
		ST.addcost(pos, n, x[pos] - x[p]);
		ST.addheight(pos, n, x[pos] - x[p]);
	}
}
int main() {
	read(n), read(k);
	for (int i = 1; i <= n - 1; i++)
		read(w[i]);
	for (int i = 1; i <= n; i++)
		read(g[i]);
	y[1] = g[1];
	for (int i = 2; i <= n; i++) {
		x[i] = y[i - 1] - w[i - 1];
		y[i] = x[i] + g[i];
	}
	static int q[MAXN]; int top = 0;
	for (int i = n; i >= 1; i--) {
		while (top >= 1 && x[i] <= x[q[top]]) top--;
		if (top >= 1) {
			fa[i] = q[top];
			a[q[top]].push_back(i);
		}
		q[++top] = i;
	}
	ST.init(n, y);
	for (int i = 1; i <= n; i++)
		if (fa[i] == 0) dfs(i, 0);
	cout << ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long INF = 1e18;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); }
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
struct SegmentTree {
	struct Node {
		int lc, rc, rev;
		ll tagh, tagc;
		ll Maxh, Minc, res;
	} a[MAXN * 2];
	int root, size, n;
	void pushdown(int root) {
		if (a[root].tagh) {
			a[a[root].lc].tagh += a[root].tagh;
			a[a[root].lc].Maxh += a[root].tagh;
			a[a[root].lc].res += a[root].tagh;
			a[a[root].rc].tagh += a[root].tagh;
			a[a[root].rc].Maxh += a[root].tagh;
			a[a[root].rc].res += a[root].tagh;
			a[root].tagh = 0;
		}
		if (a[root].tagc) {
			a[a[root].lc].tagc += a[root].tagc;
			a[a[root].lc].Minc += a[root].tagc;
			a[a[root].lc].res += a[root].tagc;
			a[a[root].rc].tagc += a[root].tagc;
			a[a[root].rc].Minc += a[root].tagc;
			a[a[root].rc].res += a[root].tagc;
			a[root].tagc = 0;
		}
	}
	ll query(int root, ll height) {
		if (a[root].lc == 0) return a[root].Minc + max(height, a[root].Maxh);
		else {
			pushdown(root);
			if (height <= a[a[root].lc].Maxh) return min(a[root].res, query(a[root].lc, height));
			else return min(height + a[a[root].lc].Minc, query(a[root].rc, max(height, a[a[root].lc].Maxh)));
		}
	}
	void update(int root) {
		a[root].Maxh = max(a[a[root].lc].Maxh, a[a[root].rc].Maxh);
		a[root].Minc = min(a[a[root].lc].Minc, a[a[root].rc].Minc);
		a[root].res = query(a[root].rc, a[a[root].lc].Maxh);
	}
	void build(int &root, int l, int r, ll *x) {
		root = ++size;
		if (l == r) {
			a[root].rev = l;
			a[root].Maxh = x[l];
			a[root].Minc = -x[l];
			a[root].res = 0;
			return;
		}
		int mid = (l + r) / 2;
		build(a[root].lc, l, mid, x);
		build(a[root].rc, mid + 1, r, x);
		update(root);
	}
	void init(int l, ll *x) {
		root = size = 0, n = l;
		build(root, 1, n, x);
	}
	void addcost(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagc += d;
			a[root].Minc += d;
			a[root].res += d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addcost(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addcost(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addcost(int l, int r, ll d) {
		addcost(root, 1, n, l, r, d);
	}
	void addheight(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagh += d;
			a[root].Maxh += d;
			a[root].tagc -= d;
			a[root].Minc -= d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addheight(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addheight(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addheight(int l, int r, ll d) {
		addheight(root, 1, n, l, r, d);
	}
	int home; ll Max, Mem;
	void dfs(int root, int l, int r, int pos, ll Lim) {
		if (pos <= l) {
			if (query(root, Max) <= Lim) {
				home = root;
				Mem = Max;
			}
			chkmax(Max, a[root].Maxh);
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (pos <= mid) dfs(a[root].lc, l, mid, pos, Lim);
		dfs(a[root].rc, mid + 1, r, pos, Lim);
	}
	int getans(int root, ll height, ll Lim) {
		if (a[root].lc == 0) return a[root].rev;
		pushdown(root);
		if (query(a[root].rc, max(height, a[a[root].lc].Maxh)) <= Lim) return getans(a[root].rc, max(height, a[a[root].lc].Maxh), Lim);
		else return getans(a[root].lc, height, Lim);
	}
	int getans(int pos, ll Lim) {
		Max = -INF, dfs(root, 1, n, pos, Lim);
		return getans(home, Mem, Lim);
	}
} ST;
ll x[MAXN], y[MAXN]; vector <int> a[MAXN];
int n, k, ans, g[MAXN], w[MAXN], fa[MAXN];
void dfs(int pos, int fa) {
	chkmax(ans, ST.getans(pos, k) - pos + 1);
	for (auto p : a[pos]) {
		ST.addcost(pos, n, x[p] - x[pos]);
		ST.addheight(pos - 1, n, x[p] - x[pos]);
		dfs(p, pos);
		ST.addcost(pos, n, x[pos] - x[p]);
		ST.addheight(pos - 1, n, x[pos] - x[p]);
	}
}
int main() {
	read(n), read(k);
	for (int i = 1; i <= n - 1; i++)
		read(w[i]);
	for (int i = 1; i <= n; i++)
		read(g[i]);
	y[1] = g[1];
	for (int i = 2; i <= n; i++) {
		x[i] = y[i - 1] - w[i - 1];
		y[i] = x[i] + g[i];
	}
	static int q[MAXN]; int top = 0;
	for (int i = n; i >= 1; i--) {
		while (top >= 1 && x[i] <= x[q[top]]) top--;
		if (top >= 1) {
			fa[i] = q[top];
			a[q[top]].push_back(i);
		}
		q[++top] = i;
	}
	ST.init(n, y);
	for (int i = 1; i <= n; i++)
		if (fa[i] == 0) dfs(i, 0);
	cout << ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long INF = 1e18;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); }
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
ll x[MAXN], y[MAXN]; vector <int> a[MAXN];
int n, k, ans, g[MAXN], w[MAXN], fa[MAXN];
struct BinaryIndexTree {
	int n; ll a[MAXN];
	void init(int x) {
		n = x;
		memset(a, 0, sizeof(a));
	}
	void modify(int x, ll d) {
		for (int i = x; i <= n; i += i & -i)
			a[i] += d;
	}
	ll query(int x) {
		ll ans = 0;
		for (int i = x; i >= 1; i -= i & -i)
			ans += a[i];
		return ans;
	}
} BIT;
struct SegmentTree {
	struct Node {
		int lc, rc, rev;
		ll tagh, tagc;
		ll Maxh, Minc, res;
	} a[MAXN * 2];
	int root, size, n;
	void pushdown(int root) {
		if (a[root].tagh) {
			a[a[root].lc].tagh += a[root].tagh;
			a[a[root].lc].Maxh += a[root].tagh;
			a[a[root].lc].res += a[root].tagh;
			a[a[root].rc].tagh += a[root].tagh;
			a[a[root].rc].Maxh += a[root].tagh;
			a[a[root].rc].res += a[root].tagh;
			a[root].tagh = 0;
		}
		if (a[root].tagc) {
			a[a[root].lc].tagc += a[root].tagc;
			a[a[root].lc].Minc += a[root].tagc;
			a[a[root].lc].res += a[root].tagc;
			a[a[root].rc].tagc += a[root].tagc;
			a[a[root].rc].Minc += a[root].tagc;
			a[a[root].rc].res += a[root].tagc;
			a[root].tagc = 0;
		}
	}
	ll query(int root, ll height) {
		if (a[root].lc == 0) return a[root].Minc + height;
		else {
			pushdown(root);
			if (height <= a[a[root].lc].Maxh) return min(a[root].res, query(a[root].lc, height));
			else return min(height + a[a[root].lc].Minc, query(a[root].rc, max(height, a[a[root].lc].Maxh)));
		}
	}
	void update(int root) {
		a[root].Maxh = max(a[a[root].lc].Maxh, a[a[root].rc].Maxh);
		a[root].Minc = min(a[a[root].lc].Minc, a[a[root].rc].Minc);
		a[root].res = query(a[root].rc, a[a[root].lc].Maxh);
	}
	void build(int &root, int l, int r, ll *x) {
		root = ++size;
		if (l == r) {
			a[root].rev = l;
			a[root].Maxh = x[l];
			a[root].Minc = -x[l];
			a[root].res = 0;
			return;
		}
		int mid = (l + r) / 2;
		build(a[root].lc, l, mid, x);
		build(a[root].rc, mid + 1, r, x);
		update(root);
	}
	void init(int l, ll *x) {
		root = size = 0, n = l;
		build(root, 1, n, x);
	}
	void addcost(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagc += d;
			a[root].Minc += d;
			a[root].res += d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addcost(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addcost(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addcost(int l, int r, ll d) {
		addcost(root, 1, n, l, r, d);
	}
	void addheight(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagh += d;
			a[root].Maxh += d;
			a[root].tagc -= d;
			a[root].Minc -= d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addheight(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addheight(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addheight(int l, int r, ll d) {
		addheight(root, 1, n, l, r, d);
	}
	int home; ll Max, Mem;
	void dfs(int root, int l, int r, int pos, ll Lim) {
		if (pos <= l) {
			if (query(root, Max) <= Lim) {
				home = root;
				Mem = Max;
			}
			chkmax(Max, a[root].Maxh);
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (pos <= mid) dfs(a[root].lc, l, mid, pos, Lim);
		dfs(a[root].rc, mid + 1, r, pos, Lim);
	}
	int getans(int root, ll height, ll Lim) {
		if (a[root].lc == 0) return a[root].rev;
		pushdown(root);
		if (query(a[root].rc, max(height, a[a[root].lc].Maxh)) <= Lim) return getans(a[root].rc, max(height, a[a[root].lc].Maxh), Lim);
		else return getans(a[root].lc, height, Lim);
	}
	int getans(int pos, ll Lim) {
		Max = BIT.query(pos) + y[pos], dfs(root, 1, n, pos, Lim);
		return getans(home, Mem, Lim);
	}
} ST;
void dfs(int pos, int fa) {
	chkmax(ans, ST.getans(pos, k) - pos + 1);
	for (auto p : a[pos]) {
		BIT.modify(pos, x[p] - x[pos]);
		ST.addcost(pos - 1, n, x[p] - x[pos]);
		ST.addheight(pos - 1, n, x[p] - x[pos]);
		dfs(p, pos);
		BIT.modify(pos, x[pos] - x[p]);
		ST.addcost(pos - 1, n, x[pos] - x[p]);
		ST.addheight(pos - 1, n, x[pos] - x[p]);
	}
}
int main() {
	read(n), read(k);
	for (int i = 1; i <= n - 1; i++)
		read(w[i]);
	for (int i = 1; i <= n; i++)
		read(g[i]);
	y[1] = g[1];
	for (int i = 2; i <= n; i++) {
		x[i] = y[i - 1] - w[i - 1];
		y[i] = x[i] + g[i];
	}
	static int q[MAXN]; int top = 0;
	for (int i = n; i >= 1; i--) {
		while (top >= 1 && x[i] <= x[q[top]]) top--;
		if (top >= 1) {
			fa[i] = q[top];
			a[q[top]].push_back(i);
		}
		q[++top] = i;
	}
	BIT.init(n);
	ST.init(n, y);
	for (int i = 1; i <= n; i++)
		if (fa[i] == 0) dfs(i, 0);
	cout << ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long INF = 1e18;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); }
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
struct SegmentTree {
	struct Node {
		int lc, rc, rev;
		ll tagh, tagc;
		ll Maxh, Minc, res;
	} a[MAXN * 2];
	int root, size, n;
	void pushdown(int root) {
		if (a[root].tagh) {
			a[a[root].lc].tagh += a[root].tagh;
			a[a[root].lc].Maxh += a[root].tagh;
			a[a[root].lc].res += a[root].tagh;
			a[a[root].rc].tagh += a[root].tagh;
			a[a[root].rc].Maxh += a[root].tagh;
			a[a[root].rc].res += a[root].tagh;
			a[root].tagh = 0;
		}
		if (a[root].tagc) {
			a[a[root].lc].tagc += a[root].tagc;
			a[a[root].lc].Minc += a[root].tagc;
			a[a[root].lc].res += a[root].tagc;
			a[a[root].rc].tagc += a[root].tagc;
			a[a[root].rc].Minc += a[root].tagc;
			a[a[root].rc].res += a[root].tagc;
			a[root].tagc = 0;
		}
	}
	ll query(int root, ll height) {
		if (a[root].lc == 0) return a[root].Minc + max(height, a[root].Maxh);
		else {
			pushdown(root);
			if (height <= a[a[root].lc].Maxh) return min(a[root].res, query(a[root].lc, height));
			else return min(height + a[a[root].lc].Minc, query(a[root].rc, max(height, a[a[root].lc].Maxh)));
		}
	}
	void update(int root) {
		a[root].Maxh = max(a[a[root].lc].Maxh, a[a[root].rc].Maxh);
		a[root].Minc = min(a[a[root].lc].Minc, a[a[root].rc].Minc);
		a[root].res = query(a[root].rc, a[a[root].lc].Maxh);
	}
	void build(int &root, int l, int r, ll *x) {
		root = ++size;
		if (l == r) {
			a[root].rev = l;
			a[root].Maxh = x[l];
			a[root].Minc = -x[l];
			a[root].res = 0;
			return;
		}
		int mid = (l + r) / 2;
		build(a[root].lc, l, mid, x);
		build(a[root].rc, mid + 1, r, x);
		update(root);
	}
	void init(int l, ll *x) {
		root = size = 0, n = l;
		build(root, 1, n, x);
	}
	void addcost(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagc += d;
			a[root].Minc += d;
			a[root].res += d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addcost(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addcost(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addcost(int l, int r, ll d) {
		addcost(root, 1, n, l, r, d);
	}
	void addheight(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagh += d;
			a[root].Maxh += d;
			a[root].tagc -= d;
			a[root].Minc -= d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addheight(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addheight(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addheight(int l, int r, ll d) {
		addheight(root, 1, n, l, r, d);
	}
	int home; ll Max, Mem;
	void dfs(int root, int l, int r, int pos, ll Lim) {
		if (pos <= l) {
			if (query(root, Max) <= Lim) {
				home = root;
				Mem = Max;
			}
			chkmax(Max, a[root].Maxh);
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (pos <= mid) dfs(a[root].lc, l, mid, pos, Lim);
		dfs(a[root].rc, mid + 1, r, pos, Lim);
	}
	int getans(int root, ll height, ll Lim) {
		if (a[root].lc == 0) return a[root].rev;
		pushdown(root);
		if (query(a[root].rc, max(height, a[a[root].lc].Maxh)) <= Lim) return getans(a[root].rc, max(height, a[a[root].lc].Maxh), Lim);
		else return getans(a[root].lc, height, Lim);
	}
	int getans(int pos, ll Lim) {
		Max = -INF, home = 0, dfs(root, 1, n, pos, Lim);
		if (home == 0) return pos;
		else return getans(home, Mem, Lim);
	}
} ST;
ll x[MAXN], y[MAXN]; vector <int> a[MAXN];
int n, k, ans, g[MAXN], w[MAXN], fa[MAXN];
void dfs(int pos, int fa) {
	chkmax(ans, ST.getans(pos, k) - pos + 1);
	for (auto p : a[pos]) {
		ST.addcost(pos - 1, n, x[p] - x[pos]);
		ST.addheight(pos - 1, n, x[p] - x[pos]);
		dfs(p, pos);
		ST.addcost(pos - 1, n, x[pos] - x[p]);
		ST.addheight(pos - 1, n, x[pos] - x[p]);
	}
}
int main() {
	read(n), read(k);
	for (int i = 1; i <= n - 1; i++)
		read(w[i]);
	for (int i = 1; i <= n; i++)
		read(g[i]);
	y[1] = g[1];
	for (int i = 2; i <= n; i++) {
		x[i] = y[i - 1] - w[i - 1];
		y[i] = x[i] + g[i];
	}
	static int q[MAXN]; int top = 0;
	for (int i = n; i >= 1; i--) {
		while (top >= 1 && x[i] <= x[q[top]]) top--;
		if (top >= 1) {
			fa[i] = q[top];
			a[q[top]].push_back(i);
		}
		q[++top] = i;
	}
	ST.init(n, y), ans = 1;
	for (int i = 1; i <= n; i++)
		if (fa[i] == 0) dfs(i, 0);
	cout << ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long INF = 1e18;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); }
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
ll x[MAXN], y[MAXN]; vector <int> a[MAXN];
int n, k, ans, g[MAXN], w[MAXN], fa[MAXN];
struct BinaryIndexTree {
	int n; ll a[MAXN];
	void init(int x) {
		n = x;
		memset(a, 0, sizeof(a));
	}
	void modify(int x, ll d) {
		for (int i = x; i <= n; i += i & -i)
			a[i] += d;
	}
	ll query(int x) {
		ll ans = 0;
		for (int i = x; i >= 1; i -= i & -i)
			ans += a[i];
		return ans;
	}
} BIT;
struct SegmentTree {
	struct Node {
		int lc, rc, rev;
		ll tagh, tagc;
		ll Maxh, Minc, res;
	} a[MAXN * 2];
	int root, size, n;
	void pushdown(int root) {
		if (a[root].tagh) {
			a[a[root].lc].tagh += a[root].tagh;
			a[a[root].lc].Maxh += a[root].tagh;
			a[a[root].lc].res += a[root].tagh;
			a[a[root].rc].tagh += a[root].tagh;
			a[a[root].rc].Maxh += a[root].tagh;
			a[a[root].rc].res += a[root].tagh;
			a[root].tagh = 0;
		}
		if (a[root].tagc) {
			a[a[root].lc].tagc += a[root].tagc;
			a[a[root].lc].Minc += a[root].tagc;
			a[a[root].lc].res += a[root].tagc;
			a[a[root].rc].tagc += a[root].tagc;
			a[a[root].rc].Minc += a[root].tagc;
			a[a[root].rc].res += a[root].tagc;
			a[root].tagc = 0;
		}
	}
	ll query(int root, ll height) {
		if (a[root].lc == 0) return a[root].Minc + max(height, y[a[root].rev] + BIT.query(a[root].rev));
		else {
			pushdown(root);
			if (height <= a[a[root].lc].Maxh) return min(a[root].res, query(a[root].lc, height));
			else return min(height + a[a[root].lc].Minc, query(a[root].rc, max(height, a[a[root].lc].Maxh)));
		}
	}
	void update(int root) {
		a[root].Maxh = max(a[a[root].lc].Maxh, a[a[root].rc].Maxh);
		a[root].Minc = min(a[a[root].lc].Minc, a[a[root].rc].Minc);
		a[root].res = query(a[root].rc, a[a[root].lc].Maxh);
	}
	void build(int &root, int l, int r, ll *x) {
		root = ++size;
		if (l == r) {
			a[root].rev = l;
			a[root].Maxh = x[l];
			a[root].Minc = -x[l];
			a[root].res = 0;
			return;
		}
		int mid = (l + r) / 2;
		build(a[root].lc, l, mid, x);
		build(a[root].rc, mid + 1, r, x);
		update(root);
	}
	void init(int l, ll *x) {
		root = size = 0, n = l;
		build(root, 1, n, x);
	}
	void addcost(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagc += d;
			a[root].Minc += d;
			a[root].res += d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addcost(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addcost(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addcost(int l, int r, ll d) {
		addcost(root, 1, n, l, r, d);
	}
	void addheight(int root, int l, int r, int ql, int qr, ll d) {
		if (l == ql && r == qr) {
			a[root].tagh += d;
			a[root].Maxh += d;
			a[root].tagc -= d;
			a[root].Minc -= d;
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (mid >= ql) addheight(a[root].lc, l, mid, ql, min(mid, qr), d);
		if (mid + 1 <= qr) addheight(a[root].rc, mid + 1, r, max(mid + 1, ql), qr, d);
		update(root);
	}
	void addheight(int l, int r, ll d) {
		addheight(root, 1, n, l, r, d);
	}
	int home; ll Max, Mem;
	void dfs(int root, int l, int r, int pos, ll Lim) {
		if (pos <= l) {
			if (query(root, Max) <= Lim) {
				home = root;
				Mem = Max;
			}
			chkmax(Max, a[root].Maxh);
			return;
		}
		pushdown(root);
		int mid = (l + r) / 2;
		if (pos <= mid) dfs(a[root].lc, l, mid, pos, Lim);
		dfs(a[root].rc, mid + 1, r, pos, Lim);
	}
	int getans(int root, ll height, ll Lim) {
		if (a[root].lc == 0) return a[root].rev;
		pushdown(root);
		if (query(a[root].rc, max(height, a[a[root].lc].Maxh)) <= Lim) return getans(a[root].rc, max(height, a[a[root].lc].Maxh), Lim);
		else return getans(a[root].lc, height, Lim);
	}
	int getans(int pos, ll Lim) {
		Max = BIT.query(pos) + y[pos];
		dfs(root, 1, n, pos, Lim);
		return getans(home, Mem, Lim);
	}
} ST;
void dfs(int pos, int fa) {
	chkmax(ans, ST.getans(pos, k) - pos + 1);
	for (auto p : a[pos]) {
		BIT.modify(pos, x[p] - x[pos]);
		ST.addcost(pos - 1, n, x[p] - x[pos]);
		ST.addheight(pos - 1, n, x[p] - x[pos]);
		dfs(p, pos);
		BIT.modify(pos, x[pos] - x[p]);
		ST.addcost(pos - 1, n, x[pos] - x[p]);
		ST.addheight(pos - 1, n, x[pos] - x[p]);
	}
}
int main() {
	read(n), read(k);
	for (int i = 1; i <= n - 1; i++)
		read(w[i]);
	for (int i = 1; i <= n; i++)
		read(g[i]);
	y[1] = g[1];
	for (int i = 2; i <= n; i++) {
		x[i] = y[i - 1] - w[i - 1];
		y[i] = x[i] + g[i];
	}
	static int q[MAXN]; int top = 0;
	for (int i = n; i >= 1; i--) {
		while (top >= 1 && x[i] <= x[q[top]]) top--;
		if (top >= 1) {
			fa[i] = q[top];
			a[q[top]].push_back(i);
		}
		q[++top] = i;
	}
	BIT.init(n);
	ST.init(n, y);
	for (int i = 1; i <= n; i++)
		if (fa[i] == 0) dfs(i, 0);
	cout << ans << endl;
	return 0;
}