#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
void CINT() {}
template <class Head, class... Tail>
void CINT(Head&& head, Tail&&... tail) {
  cin >> head;
  CINT(move(tail)...);
}
bool BitEnum(vector<bool>& inpvec, int count) {
  if (pow(2, inpvec.size()) == count) return false;
  for (int i = 0; i < (inpvec.size()); ++i) {
    inpvec[i] = count % 2;
    count /= 2;
  }
  return true;
}
int main() {
  int n, a;
  CINT(n, a);
  vector<int> x(n);
  for (auto& youso_ : (x)) cin >> youso_;
  vector<bool> vec(n, false);
  int cou = 0;
  long long ans = 0;
  while (BitEnum(vec, cou)) {
    int sum = 0;
    for (int i = 0; i < (n); ++i) sum += (vec[i] ? x[i] : 0);
    if (sum != 0 && sum % count((vec).begin(), (vec).end(), true) == 0 &&
        sum / count((vec).begin(), (vec).end(), true) == a)
      ans++;
    cou++;
  }
  cout << (ans) << endl;
  return 0;
}
