#include #include #include using namespace std; using ll = long long; int main(){ int n, w; cin >> n >> w; vector a(n); for(auto &it: a) cin >> it; set mem; int lim = 1; for(int i = 0; i < n; i++) lim *= 3; for(int bit = 1; bit < lim; bit++){ ll tot = 0; int bit1 = bit; int mask = 0; for(int i = 0; i < n; i++, bit1 /= 3){ if(bit1%3 == 0) continue; mask |= 1 << i; if(bit1%3 == 1) tot += a[i]; else tot += a[i]/2; } if(tot == w) mem.emplace(mask); } cout << mem.size() << endl; return 0; }