#include <bits/stdc++.h>
using namespace std;
long long N, A;
void dfs(long long now, long long sum, long long num_used, vector<long long>& x,
         vector<long long>& num) {
  if (now == x.size()) {
    num.push_back(A * num_used - sum);
  } else {
    dfs(now + 1, sum, num_used, x, num);
    dfs(now + 1, sum + x.at(now), num_used + 1, x, num);
  }
}
int main() {
  cin >> N >> A;
  vector<long long> x1(N / 2), x2(N - N / 2);
  for (long long i = 0; i < N / 2; ++i) {
    cin >> x1.at(i);
  }
  for (long long i = 0; i < (N - N / 2); ++i) {
    cin >> x2.at(i);
  }
  vector<long long> num1, num2;
  dfs(0, 0, 0, x1, num1);
  dfs(0, 0, 0, x2, num2);
  sort(num1.begin(), num1.end());
  sort(num2.begin(), num2.end());
  long long ans = 0;
  num1.push_back(5000000000000000000);
  long long before = num1.at(0);
  long long cnt = 0;
  for (long long i = 0; i < num1.size(); ++i) {
    long long now = num1.at(i);
    if (now == before) {
      cnt += 1;
      continue;
    }
    ans += cnt * (upper_bound(num2.begin(), num2.end(), -before) -
                  lower_bound(num2.begin(), num2.end(), -before));
    cnt = 1;
    before = now;
  }
  ans -= 1;
  cout << ans << "\n";
}
