#include using namespace std; #define mod 1000000007 int main() { long long n, k; cin >> n >> k; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); long long ans = 1; long long in = 0; for (long long i = n-1; i >= 0; i--) { for (in; in < min(n, i); in++) { if (a[in] > k - a[i]) break; } if (in < n-1-i) break; ans *= (in - (n-1-i)); ans %= mod; if (i == in) in--; } cout << ans << endl; return 0; }