#include <bits/stdc++.h>
using namespace std;
long long ar[300005];
int main() {
  long long n, k, len = 0;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> ar[i];
  }
  long long age = ar[0], pore = ar[1];
  for (long long i = 1; i < n; i++) {
    if (abs(age - pore) <= k) {
      len++;
      age = ar[i - 1];
      pore = ar[i];
    }
    pore = ar[i];
  }
  long long len1 = 0;
  age = ar[0], pore = ar[1];
  for (long long i = 1; i < n; i++) {
    if (abs(age - pore) <= k) {
      len1++;
      age = ar[i - 1];
      pore = ar[i];
    } else
      age = ar[i - 1];
  }
  cout << max(len, len1) << endl;
  return 0;
}
