#include using namespace std; int main() { int N, W; cin >> N >> W; vector a( N ); for( int i = 0; i < N; i++ ) cin >> a[i]; int l = 1 << N; int ans = 0; for( int mask = 1; mask < l; mask++ ) { vector b; long long s = 0; for( int i = 0; i < N; i++ ) { if( mask >> i & 1) { b.push_back( a[i] ); s += a[i]; } } if( s == W ) ans++; else { int n = b.size(); int l1 = 1 << n; for( int m1 = 1; m1 < l1; m1++ ) { long long ss = 0; for( int i = 0; i < n; i++ ) { if( m1 >> i & 1 ) ss += b[i] / 2; else ss += b[i]; } if( ss == W ) { ans++; break; } } } } cout << ans << endl; }