#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, a;
  long long int ans = 0;
  cin >> n >> a;
  vector<long long int> x(n);
  for (int i = 0; i < ((int)(n)); i++) {
    scanf("%d", &x[i]);
    x[i] -= a;
  }
  sort(x.begin(), x.end());
  int mi = 0, pl = n, z = 0, f = 0;
  for (int i = 0; i < ((int)(n)); i++) {
    if (f == 0 && x[i] >= 0) {
      mi = i;
      f = 1;
      i--;
    } else if (f == 1 && x[i] != 0) {
      pl = i;
      break;
    }
  }
  z = pl - mi;
  long long int mim = 0, plm = 0;
  for (int i = 0; i < ((int)(mi)); i++) mim += x[i];
  for (int i = ((int)(pl)); i <= ((int)(n - 1)); i++) plm += x[i];
  long long int ma = min(-mim, plm);
  long long int mia[ma + 1], pla[ma + 1];
  for (int i = 0; i < ((int)(ma)); i++) pla[i + 1] = mia[i + 1] = 0;
  mia[0] = 1;
  pla[0] = 1;
  for (int i = mi - 1; i >= 0; i--) {
    int j = ma + x[i];
    for (; j >= 0; j--) {
      if (mia[j] != 0) mia[j - x[i]] += mia[j];
    }
  }
  for (int i = pl; i <= n - 1; i++) {
    int j = ma - x[i];
    for (; j >= 0; j--) {
      if (pla[j] != 0) pla[j + x[i]] += pla[j];
    }
  }
  long long int c = (1ll << z);
  for (int i = 0; i < ((int)(ma + 1)); i++)
    if (mia[i] != 0 && pla[i] != 0) {
      ans += (mia[i] * pla[i]);
    }
  cout << ans * c - 1 << endl;
  return 0;
}
