#include using namespace std; using ll = long long; const ll MOD = 1000000007; using P = pair; #define rep(i, n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() int main(){ ll n,w; cin >> n >> w; vector a(n); rep(i,n) cin >> a[i]; ll ans = 0; rep(i,pow(2,n)){ if(!i) continue; ll tot = 0; set dec, dec2; dec.insert(0); dec2.insert(0); int x = i, j = 0; while(x){ if(x%2){ tot += a[j]; for(ll y:dec){ dec2.insert(y+a[j]/2); } dec = dec2; } j++; x /= 2; } ans += dec.count(tot - w); } cout << ans << endl; return 0; }