#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

long long dp[200000];
long long m = 1e9+7;

int main(){

  int n,t;
  cin >> n >> t;
  vector<int> a(n);
  for (int i=0; i<n; i++) {
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  dp[0] = 1;
  
  for (int i=1; i<n; i++) {
    int l=0;
    int r=i;
    while (l<r) {
      if (a[(l+r)/2] < a[i]-t) {
        l = (l+r)/2;
        if (l==r-1) {
          if (a[l]<a[i]-t){
            l = r;
          } else {
            r = l;
          }
        }
      } else {
        r = (l+r)/2;
      }
    }
    dp[i] = (dp[i-1]*(i-r+1)) % m;
  }
  cout << dp[n-1] << endl;
  

  return 0;
}