#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef long long ll;
int a[100000];
int main(){
	ll ans=1,mod=1e9+7;
	int N,T;
	cin>>N>>T;
	rep(i,N) cin>>a[i];
	sort(a,a+N);
	rep(i,N){
		int id=lower_bound(a,a+N,a[i]-T)-a;
		ans*=(i-id+1);
		ans%=mod;
	}
	cout<<ans<<endl;
}