#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
const int mod = 998244353;
const long long INF = 1LL << 60;
long long n, a, in[55];
vector<long long> v2[51];
vector<pair<long long, long long> > v;
int main() {
  cin >> n >> a;
  for (long long i = (long long)0; i < (long long)n; ++i) cin >> in[i];
  for (long long i = (long long)0; i < (long long)1 << (n / 2); ++i) {
    long long ct = 0, num = 0;
    for (long long j = (long long)0; j < (long long)n / 2; ++j)
      if (1 & (i >> j)) ++ct, num += in[j];
    v.push_back(pair<long long, long long>{num, ct});
  }
  for (long long i = (long long)0; i < (long long)1 << (n + 1) / 2; ++i) {
    long long ct = 0, num = 0;
    for (long long j = (long long)0; j < (long long)(n + 1) / 2; ++j)
      if (1 & (i >> j)) ++ct, num += in[n / 2 + j];
    v2[ct].push_back(num);
  }
  for (long long i = (long long)0; i < (long long)n / 2 + 2; ++i)
    sort(v2[i].begin(), v2[i].end());
  long long ans = 0;
  for (long long i = (long long)0; i < (long long)v.size(); ++i) {
    for (long long j = (long long)0; j < (long long)n / 2 + 2; ++j) {
      if (i == 0 && j == 0) continue;
      ans += (upper_bound(v2[j].begin(), v2[j].end(),
                          (v[i].second + j) * a - v[i].first) -
              lower_bound(v2[j].begin(), v2[j].end(),
                          (v[i].second + j) * a - v[i].first));
    }
  }
  cout << ans << endl;
  return 0;
}
