#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, k;
vector<int> a;
int main() {
  cin >> n >> k;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int len = 0;
  int l = 0;
  for (int i = 1; i < n; i++) {
    if (abs(a[i] - a[l]) <= k) {
      len++;
      l = i;
    }
  }
  cout << len + 1;
}
