#include <bits/stdc++.h>
using namespace std;
map<long long, long long> allCombination(vector<long long> &v) {
  int sz = v.size();
  map<long long, long long> ret;
  for (int i = 0; i < (1 << sz); i++) {
    long long t = 0;
    for (int k = 0; k < sz; k++) {
      if ((i >> k) & 1) {
        t += v[k];
      }
    }
    ret[t] += 1;
  }
  return ret;
}
long long pow(long long a, long long b) {
  long long ret = 1;
  for (long long i = 0; i < b; i++) {
    ret *= a;
  }
  return ret;
}
int main() {
  int N, A;
  cin >> N >> A;
  int x[N];
  for (int i = 0; i < N; i++) {
    cin >> x[i];
    x[i] -= A;
  }
  vector<long long> av, bv;
  int zero_n = 0;
  for (int i = 0; i < N; i++) {
    if (x[i] > 0) {
      av.push_back(x[i]);
      continue;
    }
    if (x[i] < 0) {
      bv.push_back(-x[i]);
      continue;
    }
    zero_n += 1;
  }
  if (av.size() > bv.size()) {
    swap(av, bv);
  }
  vector<long long> bv1, bv2;
  for (int i = 0; i < bv.size(); i++) {
    if (i < bv.size() / 2) {
      bv1.push_back(bv[i]);
    } else {
      bv2.push_back(bv[i]);
    }
  }
  map<long long, long long> avcombi, bv1combi, bv2combi;
  avcombi = allCombination(av);
  bv1combi = allCombination(bv1);
  bv2combi = allCombination(bv2);
  long long ans = 0;
  for (auto i : avcombi) {
    for (auto k : bv1combi) {
      if (bv2combi.find(i.first - k.first) != bv2combi.end()) {
        ans += i.second * k.second * bv2combi[i.first - k.first];
      }
    }
  }
  ans *= pow(2, zero_n);
  cout << ans - 1 << endl;
}
