#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;
long long int INF = 1e18;
long long int MOD = 1000000007;

int main(){
	
	long long int N, T;
	cin >> N >> T;
	
	vector<long long int> v;
	
	for(int i = 0; i < N; i++){
		long long int num;
		cin >> num;
		v.push_back(num);
	}
	
	sort(v.begin(), v.end());
	
	long long int ans = 1;
	for(int i = 1; i < N; i++){
		int pos = lower_bound(v.begin(), v.end(), v[i] - T) - v.begin();
		ans *= i - pos + 1;
		ans %= MOD;
	}
	
	cout << ans << endl;
	
	return 0;
}
