#include using namespace std; void solve() { int n, w; cin >> n >> w; vector A(n); for (int i = 0; i < n; i++) cin >> A[i]; set ans; for (int i = 0; i < (1<> j) & 1) A[j] /= 2; } for (int k = 0; k < (1<> j) & 1) tmp += A[j]; } if (tmp == w) { ans.insert(k); } } for (int j = 0; j < n; j++) { if ((i >> j) & 1) A[j] *= 2; } } cout << ans.size() << endl; return; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); solve(); return 0; }