#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  std::vector<int64_t> x(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  int64_t cnt = 0;
  for (int64_t i = 1; i < (1L << n); ++i) {
    int64_t val = 0, sum = 0;
    for (int j = 0; j < n; ++j) {
      if ((i >> j & 1) == 1) {
        val += x[j];
        sum += a;
      }
    }
    if (val == sum) cnt++;
  }
  cout << cnt;
}
