int main (void){
    int N ;
    int K ;
    scanf("%d",&N);
    scanf("%d",&K);
    int A[N];
    for(int i=1;i<N;i++){
        scanf("%d",&A[i]);
        }
    int ans = 0;
    int answer = 0;
    
    for(int j=0;j<(N-1);j++){
        if((A[j]-A[j+1])<=K){ans++;}
        else if((A[j+1]-A[j])<=K){ans++;}
        else {
            if(answer<ans){answer = ans;}
            ans = 0;
        }
    }
    printf("%d",answer);
return 0;
}