#include <bits/stdc++.h>
#include <atcoder/all>

#include <cstdio>
using namespace std;
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

int main() {
  ll n, k;
  cin >> n >> k;
  ll ans, b;
  ans = 1;
  rep(i, n){
      ll a;
      cin >> a;
      if (i != 0){
          if (abs(b - a) <= k){
              ans++;
          }
          b = a;
      } else {
          b = a;
      }
  }
  cout << ans << endl;
  return 0;
}