#include using i64 = long long; i64 pow(i64 x, i64 p, i64 mod) { i64 ret = 1; while (p) { if (p & 1) ret = ret * x % mod; x = x * x % mod; p >>= 1; } return ret; } i64 inv(i64 x, i64 mod) { return pow(x, mod - 2, mod); } int main() { constexpr i64 mod = 1000000007; int n, k; std::cin >> n >> k; std::vector a(n); for (auto &e : a) std::cin >> e; std::sort(a.begin(), a.end()); i64 ret = 1, c = 0; for (int i = 0; i < n; i++) { while (c < n - 1 - i && a[c] + a[n - 1 - i] <= k) c++; ret = ret * (c - i) % mod; if (c == i) break; if (c == n - 1 - i) { auto r = c - i - 1; for (i64 j = r; j > 0; j -= 2) ret = j * (j - 1) / 2 % mod * ret % mod; if (r) { i64 f = 1; for (i64 j = 2; j <= r / 2; j++) f = f * j % mod; ret = ret * inv(f, mod) % mod; } break; } } std::cout << ret << std::endl; return 0; }