#include #define rep(i,n) for(int i = 0; i < (n); ++i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair P; #define yn {puts("Yes");}else{puts("No");} #define MAX_N 200005 ll mod_pow(ll x, ll n, ll mod){ // x ^ n % mod ll res = 1; while(n > 0){ if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } int main() { int n; cin >> n; int K; cin >> K; int a[n] = {}; rep(i,n) cin >> a[i]; sort(a, a+n); ll ans = 1; const ll MOD = 1000000007; ll cnt = 0; ll l = 0; int f[n] = {}; drep(i,n){ int x = K - a[i]; if(f[i] == 0){ cnt++; f[i] = 1; } while(f[l] == 0){ if(a[l] <= x){ cnt++; f[l] = 1; l++; }else{ break; } } ans *= cnt - 1; ans %= MOD; cnt -= 2; if(i == n/2) break; } cout << ans << endl; return 0; }