#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (auto &x : a) cin >> x;
  vector<long long> ans;
  ans.push_back(a[0]);
  for (int i = 1; i < n; ++i) {
    if (abs(a[i] - ans.back()) <= k) {
      ans.push_back(a[i]);
    }
  }
  cout << ans.size();
}
