#include <bits/stdc++.h>
using namespace std;
int N, A;
int64_t C;
int main(int argc, char const *argv[]) {
  cin >> N >> A;
  vector<int> xs;
  for (size_t i = 0; i < N; i++) {
    int x;
    cin >> x;
    xs.push_back(x);
  }
  sort(xs.begin(), xs.end());
  int64_t state = 1;
  int64_t stop = 1 << N;
  int64_t ans = 0;
  while (state < stop) {
    int64_t sum = 0, cnt = 0;
    for (size_t i = 0; i < N; i++) {
      if (state & (1 << i)) {
        sum += xs[i];
        ++cnt;
      }
    }
    if (sum == cnt * A) ++ans;
    ++state;
  }
  cout << ans << endl;
  return 0;
}
