#include "bits/stdc++.h" using namespace std; const int MOD = 1e9+7; void solve() { int N, K; cin >> N >> K; vector as(N); for (int i = 0; i < N; i++) cin >> as[i]; sort(as.begin(), as.end()); if (as.front() + as.back() > K) { cout << 0 << endl; return; } long ans = 1, res = N; for (int i = N-1; i >= 0; i--) { long a = as[i]; if (a*2 <= K) break; auto it = upper_bound(as.begin(), as.end(), K-a); ans *= (long)(it-as.begin()-(N-i-1)); ans %= MOD; res-=2; } for (;res; res -= 2) { ans *= res-1; ans %= MOD; } ans %= MOD; cout << ans << endl; } int main(void) { solve(); //cout << "yui(*-v・)yui" << endl; return 0; }