#include using namespace std; long long n, w, nx = 1; long long a[13]; set s; int main() { cin >> n >> w; for (long long i = 0; i < n; i++) { cin >> a[i]; nx *= 3; } for (long long j = 0; j < nx; j++) { long long x = 0, y = j, k = 0, u = 0; while (y > 0) { if (y % 3 == 1) { x += a[k]; u += (1 << k); } else if (y % 3 == 2) { x += a[k] / 2; u += (1 << k); } y /= 3; k++; } if (x == w) s.insert(u); } cout << s.size() << endl; }