#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

template<typename T>
ostream& operator << (ostream& os, vector<T>& v){
	rep(i,v.size()){ os << v[i] << (i == v.size() - 1 ? "" : " "); } return os;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& v){
	for(T& x: v){ is >> x; } return is;
}

const long long M = 1000000007;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> d(n);
	cin >> d;

	sort(all(d));
	long long ans = 1, j = 0;
	rep(i,n){
		while(d[i] - d[j] > t) j++;
		(ans *= i - j + 1) %= M;
	}
	cout << ans << endl;
}

