#include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000000000 int main() { int N,K; cin>>N>>K; vector a(N); rep(i,N)cin>>a[i]; sort(a.rbegin(),a.rend()); mint ans = 1; int cur = N-1; rep(i,N-1){ if(a[i+1]+a[i]<=K){ int remain = N; remain -= i*2; remain --; while(remain>0){ ans *= remain; remain-=2; } break; } else{ while(a[cur]+a[i]<=K)cur--; int sum = N-1 - cur; sum -= i; if(sum<0){ ans = 0; break; } ans *= sum; } } cout<