#include <bits/stdc++.h>
using namespace std;
void sep() { cout << "-------------BLOCK-----------------\n"; }
template <typename T>
void debugv(vector<T> arr) {
  for (auto t : arr) cout << t << " ";
  cout << "\n";
}
template <typename T>
void debugarr(T arr, int n) {
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << "\n";
}
long long __min(long long a, long long b) { return a < b ? a : b; }
long long __max(long long a, long long b) { return a > b ? a : b; }
const int maxn = 3e5 + 1;
long long arr[maxn], n, m, t, k, q;
unordered_map<long long, long long> u;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<long long> tail(n, 0);
  tail[0] = arr[0];
  long long len = 1;
  for (long long i = 1; i < n; i++) {
    if (abs(tail[len - 1] - arr[i]) <= k)
      tail[len++] = arr[i];
    else
      tail[0] = arr[i];
  }
  cout << len << endl;
}
