#include <bits/stdc++.h>
int main() {
  int A, C, i, j, N, T, x[60];
  long long p, q;
  scanf("%d%d", &N, &A);
  for (i = 0; i < N; i++) scanf("%d", &x[i]);
  C = 0;
  for (p = 1; p < (1LL << N); p++) {
    T = 0;
    q = p;
    i = 0;
    j = 0;
    while (q) {
      if (q & 1LL) {
        T += x[i];
        j++;
      }
      i++;
      q >>= 1;
    }
    if (j * A == T) C++;
  }
  printf("%d\n", C);
  return 0;
}
