#include <bits/stdc++.h>
using namespace std;
using P = pair<int, long long>;
const long long inf = 1000000000007;
const int mod = 1000000007;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  int val = a[0];
  int ans = 1;
  for (int i = 1; i < (n); ++i) {
    if (abs(val - a[i]) <= k) {
      ans++;
      val = a[i];
    }
  }
  cout << ans << endl;
  return 0;
}
