#include <bits/stdc++.h>

using namespace std;
/* types */
using i32 = int32_t; using ui32 = uint32_t; using i64 = int64_t; using ui64 = uint64_t;
using f32 = float;   using f64  = double;
using PLL = pair<i64, i64>;
using PDD = pair<f64, f64>;
using VI  = vector<i64>;
using VVI = vector<VI>;
using VB  = vector<bool>;
using VS  = vector<string>;
using VPL = vector<PLL>;
using VPD = vector<PDD>;
/* constants */
constexpr i64 mod = 1000000007;                                // 10^9+7
constexpr i64 inf = 1000000000000;                             // 10^12
/* macros */
#define PB            push_back
#define PF            push_front
#define F             first
#define S             second
#define MP            make_pair
#define MAX(c)        *max_element(ALL(c))
#define MIN(c)        *min_element(ALL(c))
#define SIZE(c)       (i64)((c).size())                        // unsined int -> int64_t
#define ALL(c)        (c).begin(), (c).end()                   // for arguments
#define REV(c)        reverse(ALL(c))
#define SORT(c)       stable_sort(ALL(c))
#define RSORT(c)      stable_sort((c).rbegin(), (c).rend())
#define FOR(i, a, b)  for (i64 i=(a); i<=(b); ++i)             // a to b (up)
#define FORD(i, a, b) for (i64 i=(a); i>=(b); --i)             // a to b (down)
#define REP(i, n)     for (i64 i=0; i<(i64)(n); ++i)           // 0 to n-1
#define REPD(i, n)    for (i64 i=(i64)(n)-1; i>=0; --i)        // n-1 to 0


// for debug
void print_vec(VI& seq) {
    for (auto it = seq.begin(); it < seq.end(); ++it) {
        cout << *it << ' ';
    } 
    cout << '\n';
}


void calc_left_all_right_all(VI& seq, VI& left_all, VI& right_all) {
    i32 n = seq.size();
    i32 mid = n / 2;
    VI left, right;
    REP(i, n) {
        if (i < mid) {
            left.push_back(seq[i]);
        } else {
            right.push_back(seq[i]);
        }
    }

    i32 l_n = left.size();
    i32 r_n = right.size();
    // 半分全列挙
    REP(i, pow(2, l_n)) {
        i32 tmp = 0;
        i32 shift = 0;
        REP(j, l_n) {
            if (((i >> shift) & 1) == 1) {
                tmp += left[shift];
            }
            shift++;
        }
        left_all.push_back(tmp);
    }
    REP(i, pow(2, r_n)) {
        i32 tmp = 0;
        i32 shift = 0;
        REP(j, r_n) {
            if (((i >> shift) & 1) == 1) {
                tmp += right[shift];
            }
            shift++;
        }
        right_all.push_back(tmp);
    }

    sort(ALL(right_all));
    return;
}

i64 calc_pattern(VI& left_all, VI& sorted_right_all, i32 num) {
    i64 cnt = 0;
    for (auto it = left_all.begin(); it < left_all.end(); ++it) {
        if (*it <= num) {
            cnt += upper_bound(ALL(sorted_right_all), num - *it) - lower_bound(ALL(sorted_right_all), num - *it);
        }
    }
    return cnt;
}



void Main() {
    i32 n, a;
    cin >> n >> a;
    VI L_neg, L_zero, L_pos;
    REP(i, n) {
        i32 tmp;
        cin >> tmp;
        if (tmp - a > 0) {
            L_pos.push_back(tmp - a);
        } else if (tmp - a == 0) {
            L_zero.push_back(tmp - a);
        } else {
            L_neg.push_back(- (tmp - a));
        };
    }


    i64 ans = 0;
    ans += pow(2, L_zero.size()) - 1;
    
    if (L_pos.size() != 0 && L_neg.size() != 0) {
        VI pos_left_all, pos_right_all, neg_left_all, neg_right_all;
        calc_left_all_right_all(L_pos, pos_left_all, pos_right_all);
        calc_left_all_right_all(L_neg, neg_left_all, neg_right_all);
        // print_vec(pos_left_all);
        // print_vec(pos_right_all);
        // print_vec(neg_left_all);
        // print_vec(neg_right_all);

        i32 possible_max = min(accumulate(ALL(L_pos), 0), accumulate(ALL(L_neg), 0));
        i32 possible_min = max(MIN(L_pos), MIN(L_neg));
        
        FOR(i, possible_min, possible_max) {
            i64 pattern_pos = calc_pattern(pos_left_all, pos_right_all, i);
            i64 pattern_neg = calc_pattern(neg_left_all, neg_right_all, i);
            ans += pattern_pos * pattern_neg * pow(2, L_zero.size());
            // if (pattern_neg != 0 && pattern_pos != 0) {
            //     cout << ans << endl;
            // }
        }
    }
    cout << ans << '\n';
}

signed main() {
    cin.tie(nullptr);                                         // cin と cout の tie を切り高速化
    cout << fixed << setprecision(15);                        // 浮動小数点数が 1e-006 のように表示されることを防ぐ
    Main();
}

Measured memory_bytes: 13424