#include #include using namespace std; typedef long long ll; int main(void){ ll N, W; cin >> N >> W; vector A(N); for(int i = 0; i < N; i++){ cin >> A[i]; } ll ans = 0; for(int p = 1; p < (1 << N); p++){ for(int p2 = 0; p2 < (1 << N); p2++){ ll s = 0; for(int i = 0; i < N; i++){ int idx = (p >> i) & 1; int idx2 = (p2 >> i) & 1; if (idx & idx2){ s += A[i] / 2; }else if (idx){ s += A[i]; } } if (s == W){ ans++; break; } } } cout << ans << endl; }