#include #define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i)) #define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i)) #define ALL(x) begin(x), end(x) using ll = long long; using namespace std; template struct mint { int64_t value; mint() = default; mint(int64_t value_) : value(value_) {} inline mint operator * (mint other) const { int64_t c = this->value * int64_t(other.value) % MOD; return mint(c < 0 ? c + MOD : c); } inline mint & operator *= (mint other) { this->value = this->value * int64_t(other.value) % MOD; if (this->value < 0) this->value += MOD; return *this; } }; constexpr int MOD = 1e9 + 7; mint solve(int n, ll k, vector a) { sort(ALL(a)); mint acc = 1; int l = 0; REP (i, n / 2) { int r = n - i - 1; while (l < r and a[l] + a[r] <= k) ++ l; if (l >= r) { acc *= n - 2 * i - 1; } else { acc *= l - i; } } return acc; } int main() { int n; ll k; cin >> n >> k; vector a(n); REP (i, n) cin >> a[i]; cout << solve(n, k, a).value << endl; return 0; }