#include #include #include using namespace std; typedef long long ll; const ll mod = 1e9+7; int main(){ int n, k; cin >> n >> k; vector v(n); for(int i = 0; i < n; i++) cin >> v[i]; sort(v.begin(), v.end()); ll ans = 1; int cur = n-1; for(; 2*v[cur] >= k; cur--){ int cand = lower_bound(v.begin(), v.begin()+cur, k-v[cur]+1)-v.begin(); if(k-v[cur] <= 0 || cand-(n-1-cur) <= 0){ cout << 0 << endl; return 0; } ans *= (cand-(n-1-cur)); ans %= mod; } while(cur > 0){ ans *= cur; ans %= mod; cur -= 2; } cout << ans << endl; return 0; }