#include <bits/stdc++.h>
int N, A;
using namespace std;
long long bitsearch(vector<int> x) {
  unsigned long long int max = pow(2, N);
  int sum = 0;
  int cnt = 0;
  long long ans = 0;
  for (unsigned long long int bit = 1; bit < max; bit++) {
    for (int j = 0; j < N; j++) {
      if (bit & (1 << j)) {
        sum += x.at(j);
        cnt++;
      }
    }
    if (sum == (A * cnt)) {
      ans++;
    }
    sum = 0;
    cnt = 0;
  }
  return ans;
}
int main() {
  cin >> N >> A;
  vector<int> x(N);
  for (int i = 0; i < N; i++) cin >> x.at(i);
  cout << bitsearch(x) << endl;
  return 0;
}
