#include <iostream>
//#include <atcoder/all>
#include "ac-library/atcoder/string.hpp"

using namespace std;
using namespace atcoder;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n, 0);
    cin >> a[0];
    for(int i = 1;i < n;i++) {
        cin >> a[i];
    }
    int count = 1;
    int first = 0, last = 1;
    while(last < n) {
        int d = a[last] - a[first];
        if(abs(d) <= k) {
            count++;
            first = last;
            last++;
        } else {
            last++;
        }
    }
    cout << count << endl;
    return 0;
}
