#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <forward_list>
#include <initializer_list>
#include<random>
#include <ratio>
#include <regex>
#include <system_error>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
#if __cplusplus >= 201402L
#include <shared_mutex>
#endif

#include "atcoder/all"
using namespace atcoder;
using namespace std;
typedef long long ll;
#define pb push_back
#define rep(i, n) for(int i=0;i<(n);i++)
#define P pair<int,int>
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

namespace ori{
    template <typename T>
    void erase(std::vector<T> &v)
    {
        std::sort(v.begin(),v.end());
        v.erase(std::unique(v.begin(),v.end()),v.end());
        return;
    }

    template<typename T>
    int find_index(std::vector<T> v, T find, string key)
    {
        std::sort(v.begin(),v.end());
        if(key=="left")
        {
            return (std::distance(v.begin(),lower_bound(v.begin(),v.end(),find)));
        }
        if(key=="right")
        {
            return (std::distance(v.begin(),upper_bound(v.begin(),v.end(),find))-1);
        }
        else
        {
            return -1;
        }
    }
}

const int x8[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int y8[] = {-1, 1, 0, 0, -1, -1, 1, 1};
const int x4[] = {1, -1, 0, 0};
const int y4[] = {0, 0, -1, 1};
const int MOD = 1000000007;

void task() {
    int n,k; cin >> n >> k;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    two_sat ts(n);
    /*
    rep(i,n){
        for(int j = i+1; j < n; ++j){
            //if(i == j) continue;
            if(abs(a[i]-a[j]) <= k) ts.add_clause(i,true,j,true);
            else ts.add_clause(i,false,j,false);
        }
    }*/

    for(int i = 0;i < n-1; ++i) {
        if(abs(a[i]-a[i+1]) <= k) {
            ts.add_clause(i, true,i+1,true);
        }
        else {
            ts.add_clause(i,false,i+1, false);
        }
    }

    ts.satisfiable();

    auto ans = ts.answer();
    int cnt = 0;
    rep(i,n){
        if(ans[i]) cnt++;
    }
    cout << cnt + 1 << endl;
    //for(auto i:ans) cout<<i<<endl;

}




int main() {
    //ios::sync_with_stdio(false); cin.tie(nullptr);
    task();
    return 0;
}