#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, key, temp;
  cin >> n >> k;
  int a[n];
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  v.push_back(a[0]);
  key = a[0];
  for (int i = 0; i < n - 1; i++) {
    if (abs(key - a[i + 1]) <= k) {
      key = a[i + 1];
      v.push_back(key);
    } else
      continue;
  }
  cout << v.size() << endl;
}
