#include using namespace std; typedef long long ll; ll const mod = 1e9+7; #define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0) #define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0) const int MAX_N = 100010; ll fact[MAX_N],fact_inv[MAX_N],inv[MAX_N]; ll pow_mod(ll a,ll b) { ll ret; if (b < 0) ret = pow_mod(a,mod+b-1); else if (b == 0) ret = 1; else if (b == 1) ret = a; else { ll c = pow_mod(a,b/2); if (b%2) ret = (c*c)%mod*a%mod; else ret = c*c%mod; } return ret; } void create_table(int n) { fact[0] = 1;fact[1] = 1; for (int i = 2;i <= n;++i) fact[i] = fact[i-1]*i%mod; fact_inv[n] = pow_mod(fact[n],mod-2); for (int i = n;i > 0;--i) fact_inv[i-1] = fact_inv[i]*i%mod; for (int i = 1;i <= n;++i) inv[i] = fact_inv[i]*fact[i-1]%mod; } int main() { int n,k; ll ans = 1; cin >> n >> k; vector a(n),b(n,0); for (int i = 0;i < n;++i) cin >> a[i]; sort(a.begin(),a.end()); bool ok = true; for (int i = 0;i < n/2;++i) if (a[i]+a[n-i-1] > k) ok = false; if (!ok) ans = 0; int j = n-1; for (int i = 0;i < n;++i) { while (j >= 0 && a[i]+a[j] > k) j--; b[i] = max(n/2,j+1); } for (int i = 0;i < n-1;++i) if (a[i]+a[i+1] < k) j = (2*i+4-n)/2; for (int i = 0;i < n;++i) { ans *= b[n-1-i]-i; ans %= mod; } create_table(n); ans *= fact_inv[n/2]; ans %= mod; ans *= pow_mod(2,-j); ans %= mod; cout << ans << endl; return 0; }