#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, x[50];
  scanf("%d %d", &N, &A);
  for (int i = 0; i < N; i++) {
    scanf("%d", &x[i]);
  }
  long long ans = 0, sum, count;
  for (int i = 0; i < (1 << min(25, N)); i++) {
    sum = 0, count = 0;
    for (int j = 0; j < N; j++) {
      if ((1 << j) & i) {
        sum += x[j];
        count++;
      }
    }
    if (A == 0 && count == 0) {
      ans++;
    } else if (A != 0 && count != 0 && sum == A * count) {
      ans++;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
