#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline long long toLL(string s) {
  long long v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a;
  cin >> n >> a;
  vector<int> v(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> v[i];
  map<long long, long long> mp1;
  for (long long bit = 0; bit < (long long)((1LL << min(n, 25))); bit++) {
    long long sum = 0;
    for (long long j = 0; j < (long long)(min(n, 25)); j++) {
      if ((bit >> j) & 1) {
        sum += v[j] - a;
      }
    }
    mp1[sum]++;
  }
  map<long long, long long> mp2;
  for (long long bit = 0; bit < (long long)((1LL << max(n - 25, 0))); bit++) {
    long long sum = 0;
    for (long long j = 0; j < (long long)(max(n - 25, 0)); j++) {
      if ((bit >> j) & 1) {
        sum += v[j + 25] - a;
      }
    }
    mp2[sum]++;
  }
  long long ans = 0;
  for (auto x : mp1) {
    long long need = (-x.first);
    ans += mp2[need] * x.second;
  }
  cout << ans - 1 << endl;
  return 0;
}
