#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int res = 0;
  if (n > 16) assert(0);
  for (int bit = 0; bit < (1 << n); bit++) {
    int cnt = 0;
    int sum = 0;
    for (int i = 0; i < n; i++) {
      if ((1 << i) & bit) {
        sum += v[i];
        cnt++;
      }
    }
    if (cnt * a == sum) res++;
  }
  cout << res - 1 << endl;
}
