#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; int 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(); for( int i = 0; i < n; i++ ) { if( s - b[i] / 2 == W ) { ans++; } } } } cout << ans << endl; }