#include <bits/stdc++.h>
using namespace std;
long long cnt[2][3010][30];
int n, A, a[55];
short sum[(1 << 25) + 10];
short co[(1 << 25) + 10];
int main() {
  scanf("%d %d", &n, &A);
  for (int i = 0; i < (n); ++i) scanf("%d", a + i);
  int m = (n + 1) / 2;
  memset(sum, 0, sizeof(sum));
  memset(co, 0, sizeof(co));
  for (int i = 0; i < (1 << m); ++i) {
    if (!i) continue;
    sum[i] = sum[i ^ (i & -i)] + a[int(log2(i & -i) + 0.5)];
    co[i] = co[i ^ (i & -i)] + 1;
    if (sum[i] > n * A) continue;
    cnt[0][sum[i]][co[i]]++;
  }
  cnt[0][0][0]++;
  for (int i = 0; i < (1 << (n - m)); ++i) {
    if (!i) continue;
    sum[i] = sum[i ^ (i & -i)] + a[int(log2(i & -i) + 0.5) + m];
    co[i] = co[i ^ (i & -i)] + 1;
    if (sum[i] > n * A) continue;
    cnt[1][sum[i]][co[i]]++;
  }
  cnt[1][0][0]++;
  long long ans = 0;
  for (int i = (0); i <= (m); ++i)
    for (int j = 0; i + j <= n; ++j) {
      if (!i && !j) continue;
      int sum = (i + j) * A;
      for (int k = (0); k <= (sum); ++k) {
        ans += cnt[0][k][i] * cnt[1][sum - k][j];
      }
    }
  printf("%lld\n", ans);
  return 0;
}
