#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
int n, a, x[55];
long long res;
void solve() {
  cin >> n >> a;
  for (int i = (0); i <= (n); i++) cin >> x[i];
  for (int i = (1); i <= ((1 << n) - 1); i++) {
    int sum = 0, cnt = 0;
    for (int j = (0); j <= (n); j++) {
      if (i & (1 << j)) {
        sum += x[j];
        cnt++;
      }
    }
    if (sum == a * cnt) res++;
  }
  cout << res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (0) freopen(".in", "r", stdin);
  solve();
  return 0;
}
