#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  vector<pair<int,int>> dp(n);
  dp[0] = make_pair(a[0],1);
  rep(i,n-1){
    int next = a[i+1];
    if(abs(next-dp[i].first) <= k){
      dp[i+1] = make_pair(next,dp[i].second+1);
    }else{
      dp[i+1] = dp[i];
    }
  }
  cout << dp[n-1].second << endl;
}