#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  list<int> l;
  l.push_back(arr[0]);
  for (int i = 1; i < n; i++) {
    if (abs(arr[i] - arr[i - 1]) <= k) l.push_back(arr[i]);
  }
  cout << l.size();
}
