#include #include #include #include #include #include #include using namespace std; using ll = long long; constexpr int P = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); ll r = 1; int j = 0; for (int i = n - 1; i >= n / 2; i--) { for (; j < n; j++) { if (a[i] + a[j] > k) break; } int t = min(i, j) - (n - 1 - i); if (t <= 0) { r = 0; break; } r = r * t % P; } cout << r << endl; return 0; }