#include <bits/stdc++.h>
long N, A;
long x[100001];
long ans = 0;
void solve(int d, int c, int sum) {
  if (d > N) return;
  solve(d + 1, c, sum);
  sum += x[d];
  if ((double)sum / (c + 1) == A) ans++;
  solve(d + 1, c + 1, sum);
}
int main() {
  long i, j, k;
  long a, b, tmp;
  scanf("%ld %ld", &N, &A);
  if (N > 16) return -1;
  for (i = 1; i <= N; i++) scanf("%ld", &x[i]);
  solve(1, 0, 0);
  printf("%ld\n", ans);
  return 0;
}
