#include <bits/stdc++.h>
using namespace std;
const int mxN = 3e5 + 1;
int a[mxN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int d, ans = 0;
  for (int i = 1; i <= n; ++i)
    if (a[i] <= k) {
      d = a[i];
      ans = 1;
      break;
    }
  if (ans == 0) {
    cout << 0;
    return 0;
  }
  for (int i = 2; i <= n; ++i)
    if (fabs(a[i] - d) <= k) {
      d = a[i];
      ans++;
    }
  cout << ans;
  return 0;
}
