#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template <typename T>
using V = vector<T>;
template <typename T>
using VV = vector<vector<T>>;
template <typename T>
using VVV = vector<vector<vector<T>>>;
constexpr lint INF = 2e18;
constexpr lint MOD = 1e9 + 7;
void solve() {
  int N, A;
  cin >> N >> A;
  vector<int> X(N);
  for (auto &&it : X) {
    int t;
    cin >> t;
    it = t - A;
  }
  unordered_map<int, int> s1;
  unordered_map<int, int> s2;
  int N1 = N / 2;
  int N2 = N - N1;
  for (int x = 0; x < int(int(pow(2, N1))); x++) {
    int sum = 0;
    for (int i = 0; i < int(N1); i++) {
      if ((x >> i) & 1) {
        sum += X[i];
      }
    }
    s1[sum] += 1;
  }
  for (int x = 0; x < int(int(pow(2, N2))); x++) {
    int sum = 0;
    for (int i = 0; i < int(N2); i++) {
      if ((x >> i) & 1) {
        sum += X[N1 + i];
      }
    }
    s2[sum] += 1;
  }
  lint ans = 0;
  for (auto &&it : s1) {
    int sum = it.first;
    if (s2.count(-sum) > 0) {
      ans += (lint)it.second * s2[-sum];
    }
  }
  cout << ans - 1 << "\n";
}
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  solve();
}
