#include using namespace std; using int64 = long long; const int mod = 1e9 + 7; int N, K, A[200000]; int pos[200000]; int rec(int idx, int k) { if(idx + 1 == k) return 1; int ret = 0; if(pos[idx] - k > 0) (ret += 1LL * rec(idx - 1, k + 1) * (pos[idx] - k) % mod) %= mod; return ret; } int main() { cin >> N >> K; for(int i = 0; i < N; i++) { cin >> A[i]; } sort(A, A + N); int ptr = 0; for(int i = N - 1; i >= 0; i--) { while(ptr < i && A[i] + A[ptr] <= K) ++ptr; ptr = min(ptr, i); pos[i] = ptr; } cout << rec(N - 1, 0) << endl; }