#include<iostream>
#include<algorithm>

using namespace std;
#define MOD 1000000007
int n, t;
int d[108000];
int dp[108000];
int main(){
	cin >> n >> t;
	for(int i = 0;i < n;i++)cin >> d[i];
	sort(d, d + n);
	dp[0] = 1;
	for(int i = 1;i < n;i++){
		dp[i] = dp[i-1] * (i - (lower_bound(d, d + i, d[i]-t) - d) + 1) % MOD;
	}
	cout << dp[n-1] << endl;
}