#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const int MAX_N = 50;
int N, A;
int x[MAX_N];
int main() {
  cin >> N >> A;
  for (int(i) = 0; (i) < (N); ++(i)) cin >> x[i];
  for (int(i) = 0; (i) < (N); ++(i)) x[i] -= A;
  int m = N / 2;
  map<int, int> f;
  for (int i = 0; i < 1 << m; ++i) {
    int t = 0;
    for (int j = 0; j < m; ++j) {
      if (i >> j & 1) t += x[j];
    }
    f[t]++;
  }
  long long ans = 0;
  for (int i = 0; i < 1 << (N - m); ++i) {
    int t = 0;
    for (int j = 0; j < (N - m); ++j) {
      if (i >> j & 1) t += x[m + j];
    }
    if (f.find(-t) != f.end()) ans += f[-t];
  }
  cout << ans - 1 << endl;
  return 0;
}
