#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int i = 0; i < N; i++) {
    cin >> x.at(i);
  }
  int64_t res = 0;
  for (int64_t s = 1; s < (1L << N); s++) {
    int n = 0;
    int sum = 0;
    for (int i = 0; i < N; i++) {
      if ((s >> i) & 1L) {
        n++;
        sum += x.at(i);
      }
    }
    if (sum == A * n) res++;
  }
  cout << res << endl;
  return 0;
}
