#include <bits/stdc++.h>
using namespace std;
template <class T>
using vv = vector<vector<T> >;
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << "\t";
  }
  return s;
}
template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}
long long po2(int x) {
  if (x == 1) {
    return 2;
  } else if (x == 0) {
    return 1;
  }
  long long tmp = po2(x / 2);
  tmp *= tmp;
  if (x % 2 == 0) {
    return tmp;
  } else {
    return tmp * 2;
  }
}
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (int(i) = (0); (i) < (n); ++(i)) {
    cin >> x[i];
    x[i] -= a;
  }
  sort(begin(x), end(x));
  auto mark1 = lower_bound(begin(x), end(x), 0);
  auto mark2 = upper_bound(begin(x), end(x), 0);
  int be = *begin(x) * *(end(x) - 1);
  long long base = po2(mark2 - mark1);
  if (be > 0) {
    printf("0\n");
    return 0;
  } else if (be == 0) {
    printf("%lld\n", base - 1);
    return 0;
  }
  vector<vector<int> > part(2, vector<int>());
  for (int i = 0; x[i] < 0; ++i) {
    part[0].emplace_back(-x[i]);
  }
  sort(begin(part[0]), end(part[0]));
  for (int i = mark2 - begin(x); i < n; ++i) {
    part[1].emplace_back(x[i]);
  }
  int ma = 9;
  vector<vector<long long> > p(2, vector<long long>(ma, 0));
  p[0][0] = p[1][0] = 1;
  int currentmax = 0;
  for (int(i) = (0); (i) < (2); ++(i)) {
    currentmax = 0;
    for (int(j) = (0); (j) < ((int)part[i].size()); ++(j)) {
      vector<long long> tmp(ma, 0);
      for (int(k) = (0); (k) < (currentmax + 1); ++(k)) {
        tmp[part[i][j] + k] += p[i][k];
      }
      currentmax += part[i][j];
      for (int(k) = (0); (k) < (ma); ++(k)) {
        p[i][k] += tmp[k];
      }
    }
  }
  long long ans = 0;
  for (int(i) = (0); (i) < (ma); ++(i)) {
    ans += p[0][i] * p[1][i];
  }
  printf("%lld\n", ans * base - 1);
  return 0;
}
