#include <bits/stdc++.h>
const int MAXN = 55;
int array[MAXN]{};
int A, N;
long long Ans;
int main() {
  scanf(" %d%d", &N, &A);
  for (int i = 0; i < N; ++i) scanf("%d", &array[i]);
  std::sort(array, array + N);
  int LIM = 1 << N;
  for (int mask = 1; mask < LIM; ++mask) {
    int tem[2]{};
    for (int bit = 0; bit < N; ++bit)
      if ((mask >> bit) & 1) {
        tem[0] += array[bit];
        ++tem[1];
      }
    if (tem[0] == A * tem[1]) ++Ans;
  }
  printf("%lld\n", Ans);
  return 0;
}
