#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;


#define ll long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(x) (x).begin(),(x).end()


int main()
{
	ll n,k;
	cin>>n>>k;

	vector <ll> a(n);
	for(auto &x:a)
		cin>>x;
	ll j=1;
	ll ans=0;
	vector <ll> v;
	for(int i=0;i<n && j<n;)
	{
		ll x=abs(a[i]-a[j]);
		if(x<=k && j<n)
		{
		v.push_back(a[i]);
		i=j;
		j++;
		if(j>=n)
			v.push_back(a[i]);
		}
		else
		j++;

	}
	

	cout<<v.size()<<endl;
}



