#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  int i = 0, j = 1;
  while (i < n - 1) {
    if (abs(a[i] - a[j]) > k) {
      a[j] = -1;
      j++;
    } else {
      i = j;
      j = i + 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < (n); i++)
    if (a[i] >= 0) ans++;
  cout << ans << endl;
  return 0;
}
