#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MOD = 1e9 + 7;

int n, t;
int d[100010];

int main()
{
	cin >> n >> t;
	for (int i = 0; i < n; i++){
		cin >> d[i];
	}
	sort(d, d + n);
	
	long long res = 1;
	for (int i = 0; i < n; i++){
		int l = i - (lower_bound(d, d + i, d[i] - t) - d);
		res = res * (l + 1) % MOD;		
	}

	cout << res << endl;
}