#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
using vv = vector<vector<T>>;
const int INF = 1002003004;
const ll LINF = 1002003004005006007ll;
struct preprocess {
  preprocess() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} ____;
int main() {
  int n, a;
  cin >> n >> a;
  vi x(n);
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  for (int i = 0; i < (int)(n); i++) x[i] -= a;
  map<int, ll> m1, m2;
  int hn = n / 2;
  for (int i = (int)(1); i < (int)((1LL << (hn))); i++) {
    int tot = 0;
    for (int j = 0; j < (int)(hn); j++) {
      if ((1LL << (j)) & i) {
        tot += x[j];
      }
    }
    m1[tot] = m1[tot] + 1;
  }
  for (int i = (int)(1); i < (int)((1LL << (n - hn))); i++) {
    int tot = 0;
    for (int j = 0; j < (int)(n - hn); j++) {
      if ((1LL << (j)) & i) {
        tot += x[j + hn];
      }
    }
    m2[tot] = m2[tot] + 1;
  }
  ll ans = m1[0] + m2[0];
  for (auto it = m1.begin(); it != m1.end(); it++) {
    ans += m2[-it->first] * it->second;
  }
  cout << ans << '\n';
}
