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