#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
template <typename T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
template <typename T = ll>
inline T in() {
  T ret;
  cin >> ret;
  return ret;
}
int main() {
  ll n = in(), a = in();
  if (n == 1) {
    cout << (in() == a ? 1 : 0) << endl;
  } else {
    vector<ll> x(n);
    for (ll i = 0, i_len = (n); i < i_len; ++i) x[i] = in();
    auto itr = x.begin() + x.size() / 2;
    vector<ll> x1(x.begin(), itr), x2(itr, x.end());
    vector<ll> v1, v2;
    for (ll i = 0, i_len = (1 << x1.size()); i < i_len; ++i) {
      ll sum = 0, cnt = 0;
      for (ll j = 0, j_len = (x1.size()); j < j_len; ++j) {
        if ((i >> j) & 1) {
          sum += x1[j];
          ++cnt;
        }
      }
      v1.push_back(sum - a * cnt);
    }
    for (ll i = 0, i_len = (1 << x2.size()); i < i_len; ++i) {
      ll sum = 0, cnt = 0;
      for (ll j = 0, j_len = (x2.size()); j < j_len; ++j) {
        if ((i >> j) & 1) {
          sum += x2[j];
          ++cnt;
        }
      }
      v2.push_back(a * cnt - sum);
    }
    sort((v2).begin(), (v2).end());
    ll ans = 0;
    for (auto v : v1)
      ans += upper_bound((v2).begin(), (v2).end(), v) -
             lower_bound((v2).begin(), (v2).end(), v);
    cout << ans - 1 << endl;
  }
}
