#include #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; int main() { ll N, W; cin >> N >> W; vector a(N); rep(i, 0, N) cin >> a[i]; int x = 1; rep(i, 0, N) x *= 3; vector ok(1 << N, false); rep(i, 0, x) { ll s = 0, y = i, b = 0; rep(j, 0, N) { int r = y % 3; y /= 3; b *= 2; if (r == 1) s += a[j] / 2; if (r == 2) s += a[j]; if (r > 0) b++; } //cout << i << " " << s << endl; if (s == W) { ok[b] = true; } } int ans = 0; rep(i, 0, 1 << N) ans += ok[i]; cout << ans << endl; }