#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[i];
  int ans = 0;
  for (int i = 1; i < (1 << n); i++) {
    int sum = 0, k = 0, num = 0;
    for (int j = 1; j < pow(2, n); j *= 2) {
      if (i & j) {
        sum += x[k];
        num++;
      }
      k++;
    }
    if (sum == num * a) ans++;
  }
  cout << ans << endl;
  return 0;
}
