#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  int k;
  cin >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  int c = 0;
  int i = 0;
  int ans = a[i];
  while (i < n) {
    if (abs(a[i] - ans) <= k) {
      c++;
      ans = a[i];
    }
    i++;
  }
  cout << c << endl;
}
