#include using namespace std; typedef long long ll; typedef pair P; #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (ll i = m; i < n; i++) #define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define SZ(x) ll(x.size()) int main() { ll n, w; cin >> n >> w; vector a(n); REP(i, n) { cin >> a[i]; } ll N = 1LL << n; ll ans = 0; FOR(c, 1, N) { bool ok = false; REP(b, N) { ll cnt = 0; REP(i, n) { bool isHalf = (b & (1LL << i)) > 0; bool select = (c & (1LL << i)) > 0; ll price = isHalf ? a[i] / 2 : a[i]; if (select) { cnt += price; } } if (cnt == w) { ok = true; break; } } if (ok) { ans++; } } cout << ans << endl; }