#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
const int mod = 1e9 + 9;
const int INF = 1e9;
int main() {
  int n, k;
  cin >> n >> k;
  vi vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  int index = vec[0];
  int cnt = 1;
  for (int i = 1; i < n; i++) {
    if (abs(index - vec[i]) <= k) {
      index = vec[i];
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
