#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair
#define MOD 1000000007

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	int n, t;
	cin >> n >> t;

	vector<int> v(n);
	rep(i, n) cin >> v[i];

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

	ll ans = 1;
	vector<int> res;
	rep(i, n) {
		res.push_back(v[i]);
		int id = lower_bound(res.begin(), res.end(), v[i] - t) - res.begin();
		ans *= (res.size() - id);
		ans %= MOD;
	}

	cout << ans << endl;

	return 0;
}