#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define ll long long
typedef pair<ll, ll> P;
//const ll INF = 1LL << 60;
//using mint = modint1000000007;
using mint = modint998244353;
//const int MOD = 1000000007;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

int n,k;
int dp[303030];
int main(){
    cin>>n>>k;
    vector<int>a(n);
    rep(i,n)cin>>a[i];
    dp[0]=1;
    for(int i=1;i<n;i++){
      if(abs(a[i]-a[i-1])<=k){
        dp[i]+=dp[i-1]+1;
      }else dp[i]=dp[i-1];

    }
    cout<<dp[n-1]<<endl;
    return 0;
}

    