#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  long long n, k;
  scanf("%lld ", &n);
  scanf("%lld ", &k);
  long long arr[n];
  for (long long i = 0; i < n; i++) scanf("%lld ", &arr[i]);
  long long ans[n];
  for (long long i = 0; i < n; i++) ans[i] = 0;
  long long j = 0;
  for (long long i = 0; i < n; i++) {
    if (abs(arr[i + 1] - arr[i]) <= k)
      ans[j]++;
    else
      j++;
  }
  long long res = 0;
  for (long long i = 0; i < n; i++) res += ans[i];
  printf("%lld \n", res);
  return 0;
}
