#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

int main(){
  int n,k,x,tmp,last,ans = 1;
  cin >> n >> k;
  for(int i=0;i<n;i++){
    cin >> x;
    if(i==0){
      last = x;
    }else{
      tmp = abs(x - last);
      if(tmp > k){
        continue;
      }else{
        last = x;
        ans++;
      }
    }
  }
  	cout << ans << endl;
}