#include <bits/stdc++.h>
int x[50], A, N;
long long int ans;
void select(int rest, int count, int limit, int i);
void swap(int *n1, int *n2) {
  int tmp = *n1;
  *n1 = *n2;
  *n2 = tmp;
}
int main(void) {
  int i, j;
  scanf("%d%d", &N, &A);
  for (i = 0; i < N; i++) {
    scanf("%d", &x[i]);
  }
  for (i = N - 1; i > 0; i--) {
    for (j = 0; j < i; j++) {
      if (x[j] < x[j + 1]) swap(&x[j], &x[j + 1]);
    }
  }
  for (i = 1; i <= N; i++) {
    select(A * i, 0, i, 0);
  }
  printf("%lld\n", ans);
  return 0;
}
void select(int rest, int count, int limit, int i) {
  if (N < i) {
    return;
  } else if (rest < 0) {
    return;
  } else if (rest == 0 && limit == count) {
    ans++;
    return;
  } else {
    if (rest >= (limit - count) * x[i]) {
      select(rest, count, limit, i + 1);
    }
    if (limit >= count + 1) {
      select(rest - x[i], count + 1, limit, i + 1);
    }
  }
}
