#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  ll n, k, cnt, cur, nxt;
  cin >> n >> k >> cur;
  cnt = n;
  for (int i = 0; i < (n - 1); ++i) {
    cin >> nxt;
    if (abs(cur - nxt) > k) {
      cnt--;
      continue;
    } else
      cur = nxt;
  }
  cout << cnt;
  return 0;
}
