#include <bits/stdc++.h>
using namespace std;
int a[300005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a[i];
  }
  int count = 0, now, ans = -1;
  bool first = false, mn = a[0];
  for (int i = 1; i <= n - 1; i++) {
    if (first == false) {
      if (abs(a[i] - now) <= k) {
        first = true;
        now = a[i];
        count = 2;
      } else {
        now = min(now, a[i]);
      }
      continue;
    }
    if (abs(a[i] - now) <= k) {
      now = a[i];
      count++;
    }
  }
  cout << count << '\n';
  return 0;
}
