#include <bits/stdc++.h>
int n;
double card[50];
double a;
int count = 0;
void func(int, double, int);
int main(void) {
  int i;
  scanf("%d %lf", &n, &a);
  for (i = 0; i < n - 1; i++) {
    scanf("%lf ", &card[i]);
  }
  scanf("%lf", &card[n - 1]);
  func(0, 0, 1);
  printf("%d\n", count);
  return 0;
}
void func(int d, double value, int num) {
  int i;
  double tmp;
  for (i = d; i < n; i++) {
    tmp = value + card[i];
    if (tmp / num == a) {
      count++;
    }
    func(i + 1, tmp, num + 1);
  }
}
