#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const long long MOD = 1000000007;
using namespace std;
int main(int argc, char* argv[]) {
  int n, A;
  scanf("%d%d", &n, &A);
  vector<int> a(n);
  int i, j;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i] -= A;
  }
  int m = n / 2;
  map<long long, int> z0;
  for (i = 0; i < ((long long)1 << m); i++) {
    long long s = 0;
    for (j = 0; j < m; j++) {
      if (i & ((long long)1 << j)) s += a[j];
    }
    z0[s]++;
  }
  int m1 = n - m;
  map<long long, int> z1;
  for (i = 0; i < ((long long)1 << m1); i++) {
    long long s = 0;
    for (j = 0; j < m1; j++) {
      if (i & ((long long)1 << j)) {
        s += a[m + j];
      }
    }
    z1[-s]++;
  }
  long long ans = 0;
  auto it = z0.begin();
  for (; it != z0.end(); ++it) {
    long long tmp = it->first;
    if (z1.find(tmp) != z1.end()) {
      ans += (long long)z0[tmp] * z1[tmp];
    }
  }
  printf("%lld\n", ans - 1);
  return 0;
}
