#include <bits/stdc++.h>
using namespace std;
const long long int infi = 1e15 + 7;
void printVector(vector<long long int> v) {
  for (long long int i = 0; i < (long long int)v.size(); i++)
    cout << v[i] << " ";
  cout << endl;
}
void printArray(long long int arr[], long long int n) {
  for (long long int i = 0; i < n; i++) cout << arr[i] << ' ';
  cout << endl;
}
set<pair<long long int, long long int>> primeset;
vector<long long int> prime_number;
void SieveOfEratosthenes(long long int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++)
    if (prime[p]) primeset.insert(make_pair(p, 1));
}
long long modExp(long long base, long long power) {
  if (power == 0) {
    return 1;
  } else {
    long long cur = modExp(base, power / 2);
    cur = cur * cur;
    cur = cur % 1000000007;
    if (power % 2 == 1) cur = cur * base;
    cur = cur % 1000000007;
    return cur;
  }
}
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2>& p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
long long int n;
long long int k;
long long int solve(long long int arr[], long long int index = n - 1,
                    long long int prev = -1) {
  if (index < 0) return 0;
  long long int ans = 0;
  if (prev == -1) {
    ans =
        max(solve(arr, index - 1, prev), solve(arr, index - 1, arr[index]) + 1);
  } else {
    ans = max(solve(arr, index - 1, prev),
              solve(arr, index - 1, arr[index]) +
                  ((abs(prev - arr[index - 1]) >= k ? 1 : 0)));
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t = 1;
  long long int tt = 0;
  while (t--) {
    ;
    cin >> n;
    cin >> k;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    cout << solve(arr);
  }
  return 0;
}
