#include<iostream>
#include<algorithm>
using namespace std;
long long n, x[1 << 20], t, p = 1;
int main() {
	cin >> n >> t;
	for (int i = 0; i < n; i++)
	{
		cin >> x[i];
	}
	sort(x, x + n);
	for (int i = 0; i < n; i++)
	{
		long long s = 0;
		for (int j = i; j >= 0; j--)
		{
			if (x[i] - x[j] > t) { break; }
			s++;
		}
		p *= s;
		p %= 1000000007;
	}
	cout << p << endl;
	return 0;
}