#include <bits/stdc++.h>

using namespace std;

#define modulo ll (1e9 + 7)
#define neig(a, u, e, v) for(int v, e = (a).head[u] ; ~e and (v = (a).to[e], 1) ; e = (a).nxt[e])

typedef long long ll;

const int N = 2e5 + 9, M = 1e6 + 9, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;

int main() {
    cin.tie(0);
    cin.sync_with_stdio(0);

    int n;
    cin >> n;
    
    ll x;
    cin >> x;

    int a[n];
    for(int i = 0;i < n;i++)
        cin >> a[i];
    
    int ans = 0; // number of subsets with sum equal to x
    
    // the binary representation of i represents the subset
    for(int i = 0;i < (1 << n);i++){
        ll sum = 0;// subset sum
        for(int j = 0;j < n;j++){
            // check if the j-th bit of i is 1 (j-th element is included in the subset)
            if((i >> j) & 1){
                sum += a[j];
            }
        }
        
        if(sum == x)
            ans++;
    }
    
    cout << ans;
}