#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-10;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int main()
{
	int n, t;
	cin >> n >> t;
	vi v(n);
	REP(i, n) cin >> v[i];
	sort(ALL(v));
	ll ans = 1;
	REP(i, n)
	{
		int l = v.begin() + i - lower_bound(v.begin(), v.begin() + i, v[i] - t);
		ans *= l + 1;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}