#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; long long w; cin >> n >> w; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } int ans = 0; for (int st = 0; st < (1 << n); st++) { long long tmp = 0; for (int i = 0; i < n; i++) { if (st & (1 << i)) { tmp += a[i]; } } for (int sub = st;; sub = (sub - 1) & st) { long long dis = 0; for (int i = 0; i < n; i++) { if (sub & (1 << i)) { dis += a[i] / 2; } } if (tmp - dis == w) { ans++; break; } if (sub == 0) break; } } cout << ans << endl; }