#include "bits/stdc++.h" #define int long long using namespace std; using ll = long long; using P = pair; const ll INF = (1LL << 61); ll mod = 998244353; signed main() { ios::sync_with_stdio(false); cin.tie(0); int N, W; cin >> N >> W; int T = 1; for (int i = 0; i < N; i++)T *= 3; vectora(N); for (int i = 0; i < N; i++)cin >> a[i]; setst; for (int bit = 0; bit < T; bit++) { int sum = 0; int now = bit; int b = 0; for (int j = 0; j < N; j++) { int t = now % 3; now /= 3; int idx = N - j - 1; if (t == 0) { b |= (1 << idx); sum += a[idx]; } else if (t == 1) { b |= (1 << idx); sum += a[idx] / 2; } } if (sum == W)st.insert(b); } int ans = st.size(); if (W == 0)ans--; cout << ans << endl; return 0; }