#include<bits/stdc++.h>
#include <atcoder/all>
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)

using namespace std;
using namespace atcoder;
using ll = long long;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int mae = 0, ato = 1;
    int ans = n;
    rep(i, n) {
        if (i != n - 1) ato = i + 1;
        if (abs(a[mae] - a[i]) > k) {
            ans--;
        }
        else {
            mae = i;
        }

    }
    cout << ans << endl;
    return 0;
}