#include using namespace std; using int64 = long long; typedef pair P; const int mod = 1e9 + 7; int main(){ int n, k; cin >> n >> k; vector a(n); for(int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); int64 ans = 1, l = 0, cnt = 0; for(int r = n - 1; r >= n / 2; r--){ while(l < n && a[l] + a[r] <= k){ // cout << " " << l << " " << r << " " << a[l] + a[r] << endl; l++; cnt++; } if(r < l) cnt--; // cout << r << ' ' << l << ' ' << cnt << endl; ans = (ans * cnt) % mod; cnt--; } cout << ans << endl; }