#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define BE(x) x.begin(), x.end()

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];

    int ans = 1, x = a[0], y;
    for (int i = 1; i < n; i++) {
        y = a[i];
        if (abs(y-x) <= k) {
            x = y;
            ans++;
        }
    }
    cout << ans << endl;
}