#include <bits/stdc++.h>
using namespace std;
int N, A;
vector<int> X;
int ans = 0;
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; ++i) {
    int buf;
    cin >> buf;
    X.push_back(buf);
  }
  if (X.size() > 16) {
    cout << 0 << endl;
    return 0;
  }
  for (int cnt = 0; cnt < (int)(pow(2, X.size()) + 0.0001); ++cnt) {
    int sum = 0;
    int num = 0;
    for (int i = 0; i < X.size(); ++i) {
      if (cnt & (1 << i)) {
        sum += X[i];
        ++num;
      }
    }
    if (num > 0 && sum == A * num) {
      ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}
