#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <unordered_map>

using namespace std;
typedef long long ll;

const ll MD = 1e9+7;
int main() {
    int n, k;
    cin >> n >> k;
    vector<int> v;
    for (int i = 0; i < n; i++) {
        int d;
        cin >> d;
        v.push_back(d);
    }
    sort(v.begin(), v.end());
    ll res = 1;
    for (int i = 0; i < (int)v.size(); i++) {
        res *= (v.begin()+i) - lower_bound(v.begin(), v.begin()+i, v[i]-k) + 1;
        res %= MD;
    }
    cout << res << endl;
    return 0;
}