#include <bits/stdc++.h>
using namespace std;
int const N = 55;
int n;
double A;
int a[N];
void small() {
  int ans = 0;
  for (int mask = 0; mask < (1 << n); mask++) {
    double soma = 0;
    double cnt = 0;
    for (int i = 0; i < n; i++)
      if ((1 << i) & mask) {
        cnt++;
        soma += a[i];
      }
    if ((soma / cnt) == A) ans++;
  }
  printf("%d\n", ans);
}
void solve() {
  if (n <= 16) {
    small();
    return;
  }
}
int main() {
  cin >> n >> A;
  for (int i = 0; i < n; i++) cin >> a[i];
  solve();
  return 0;
}
