#include <bits/stdc++.h>
int n, k1, a[53], i, ik, ik1, left, right, s, t, ee[53];
unsigned long long count;
void findleft(int k, int index);
void findright(int k, int index);
void findleft(int k, int index) {
  if (k > left || left == 0) {
    for (right = 1; right <= n - ik; right++) findright(1, ik - 1);
    return;
  }
  int j;
  for (j = index + 1; j < ik; j++) {
    t++;
    ee[t] = a[j];
    s += a[j];
    findleft(k + 1, j);
    ee[t] = 0;
    t--;
    s -= a[j];
  }
}
void findright(int k, int index) {
  int j;
  if (k > right) {
    if (s / ((float)left + right) == k1) {
      count++;
    }
    return;
  }
  for (j = index + 1; j < n; j++) {
    if (s + a[j] > k1 * (left + right)) break;
    t++;
    ee[t] = a[j];
    s += a[j];
    findright(k + 1, j);
    ee[t] = 0;
    t--;
    s -= a[j];
  }
}
int comp(const void* a, const void* b) { return *(int*)a - *(int*)b; }
int main(void) {
  scanf("%d %d", &n, &k1);
  for (i = 0; i < n; i++) scanf("%d", a + i);
  qsort(a, n, sizeof(int), comp);
  if (a[n - 1] < k1 || a[0] > k1) {
    printf("0");
    return 0;
  }
  for (i = 0; i < n; i++) {
    if (a[i] >= k1) {
      ik = i;
      break;
    }
  }
  for (left = 0; left <= ik; left++) {
    findleft(1, -1);
  }
  printf("%d", count);
  return 0;
}
