#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, count = 1, m, p, i;
  cin >> n >> k;
  cin >> m;
  for (i = 0; i < n - 1; i++) {
    cin >> p;
    if (abs(m - p) <= k) {
      count++;
      m = p;
    }
  }
  cout << count << endl;
  return 0;
}
