#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define all(v) (v).begin(),(v).end()

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int a[MAX_N];
int n,t;

int main()
{
	scanf("%d%d",&n,&t);
	rep(i,n){
		scanf("%d",&a[i]);
	}
    sort(a,a+n);
    int np = 0;
    ll res = 1;
    rep(i,n){
        while(np < i){
            if(a[i] - a[np] <= t){
                break;
            }
            np++;
        }
        res = res * (i - np + 1) % MOD;
    }
    cout << res << "\n";
	return 0;
}