#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

using lint = long long;
using ldouble = long double;

const lint MOD = 1000000007;

int main() {
    int N, T;
    cin >> N >> T;
    vector<int> D(N);
    for (auto& d : D) cin >> d;

    sort(D.begin(), D.end());

    lint ans = 1;
    for (int i = 0; i < N; ++i) {
        ans *= i - (lower_bound(D.begin(), D.end(), D[i] - T) - D.begin() - 1);
        ans %= MOD;
    }

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

