#include using namespace std; using int64 = long long; const int mod = 1e9 + 7; int main() { int N, K; cin >> N >> K; vector< int > A(N); for(int i = 0; i < N; i++) cin >> A[i]; function< int(int, int) > dfs = [&](int idx, int bit) { if(idx == N) return 1; if((bit >> idx) & 1) return dfs(idx + 1, bit); int ret = 0; for(int i = idx + 1; i < N; i++) { if((bit >> i) & 1) continue; if(A[idx] + A[i] <= K) (ret += dfs(idx + 1, bit | (1 << idx) | (1 << i))) %= mod; } return ret; }; cout << dfs(0, 0) << endl; }