#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, k;
  cin >> n >> k;
  int temp;
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  temp = a[0];
  vector<int> b;
  b.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    if (abs(a[i] - temp) <= k) {
      temp = a[i];
      b.push_back(a[i]);
    } else {
      int d = b.size() - 2;
      if (abs(a[i] - b[d]) <= k) {
        b.pop_back();
        b.push_back(a[i]);
      }
    }
  }
  cout << b.size();
}
