#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  int n, k;
  cin >> n >> k;
  vector<int> a;
  for (int i = 0; i < (n); i++) {
    int inter;
    cin >> inter;
    a.push_back(inter);
  }
  int mae = a[0];
  for (int i = 1; i < (n); i++) {
    if (abs(mae - a[i]) <= k) {
      if (ans == 0) {
        ans++;
      }
      mae = a[i];
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
