#include <bits/stdc++.h>
using namespace std;
int main() {
  char buffer[0x20000];
  cin.ios_base::sync_with_stdio(false);
  cin.rdbuf()->pubsetbuf(buffer, 0x20000);
  int n, A, sum, hsh[5010] = {0}, v[55];
  int64_t res = 0;
  cin >> n >> A;
  for (int x, i = 0; i < n; ++i) cin >> x, v[i] = (x - A);
  for (int i = 1; i < (1 << n / 2); ++i) {
    int bitset = i;
    sum &= 0;
    for (int y = 0, j = 1; j <= bitset; j <<= 1, ++y)
      if (bitset & j) sum += v[y];
    if (sum == 0) ++res;
    ++hsh[2500 + sum];
  }
  if (!A) res += 1;
  for (int i = 1; i < (1 << (n / 2 + n % 2)); ++i) {
    int bitset = i;
    sum &= 0;
    for (int y = 0, j = 1; j <= bitset; j <<= 1, ++y)
      if (bitset & j) sum -= v[n / 2 + y];
    if (sum == 0) ++res;
    res += hsh[2500 + sum];
  }
  cout << res;
  return 0;
}
