#include<bits/stdc++.h>

using namespace std;
#define ll long long int
ll const mod=3e9;
vector<ll>v1[100001];
vector<ll>v2(100001,0);
//vector<ll>h(100001,0);

void dfs(ll i)
{
    v2[i]=1;
    for(int j=0;j<v1[i].size();j++)
    {
        if(v2[v1[i][j]]==0)
        {
            dfs(v1[i][j]);
        }
    }
}

int main()
{
    ll n;
    cin>>n;
    ll k;
    cin>>k;
    ll a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll b[n]={1};
    for(int i=1;i<n;i++)
    {
        if(abs(a[i]-a[i-1])<=k)
            b[i]=b[i-1]+1;
        else
            b[i]=b[i-1];
    }
    cout<<b[n-1];
}
