#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = LLONG_MAX;
const long double pi = acosl(-1);
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n, a;
  cin >> n >> a;
  vector<ll> x(n);
  for (ll i = 0; i < n; i++) {
    cin >> x[i];
    x[i] -= a;
  }
  unordered_map<ll, ll> mp;
  vector<bool> v(n / 2, false);
  ll m = pow(2, n / 2);
  for (ll i = 0; i < m; i++) {
    ll sum = 0;
    for (ll j = 0; j < n / 2; j++) {
      if (v[j]) sum += x[j];
    }
    mp[sum]++;
    ll z = n / 2 - 1;
    while (z >= 0 && v[z]) {
      v[z] = false;
      z--;
    }
    if (z >= 0) v[z] = true;
  }
  ll ans = 0;
  m = pow(2, n - n / 2);
  if (n % 2) v.push_back(false);
  for (ll i = 0; i < m; i++) {
    ll sum = 0;
    for (ll j = 0; j < n - n / 2; j++) {
      if (v[j]) sum += x[j + n / 2];
    }
    ans += mp[-sum];
    ll z = n - n / 2 - 1;
    while (z >= 0 && v[z]) {
      v[z] = false;
      z--;
    }
    if (z >= 0) v[z] = true;
  }
  cout << ans - 1 << endl;
}
