#include <bits/stdc++.h>
using namespace std;
vector<int> x(50, 0);
const double eps = 1e-10;
const double pi = acos(-1.0);
const double inf = (int)1e8;
template <typename T>
inline std::string to_bin_str(T n, std::size_t digit_num) {
  std::string str;
  while (n > 0) {
    str.push_back('0' + (n & 1));
    n >>= 1;
  }
  str.resize(digit_num, '0');
  std::reverse(str.begin(), str.end());
  return str;
}
int main() {
  int n, a;
  std::cin >> n >> a;
  for (unsigned long long i = (0); i < unsigned long long(n); ++i)
    std::cin >> x[i];
  long long tmp = 0, count = 0, ans = 0;
  string s;
  for (unsigned long long i = (1); i < unsigned long long(pow(2, n)); ++i) {
    tmp = 0, count = 0;
    s = to_bin_str(i, n);
    for (unsigned long long j = (0); j < unsigned long long(n); ++j) {
      if (s[j] == '1') {
        tmp += x[j];
        count++;
      }
    }
    if ((double)tmp / count == (double)a) {
      ans++;
    }
  }
  std::cout << ans << std::endl;
}
