#include <bits/stdc++.h>
using namespace std;
long long cnt[2][3010][55], a[55];
int main() {
  int n, A;
  scanf("%d %d", &n, &A);
  for (int i = 0; i < (n); ++i) scanf("%lld", a + i);
  int m = n / 2;
  for (int i = 0; i < (1 << m); ++i) {
    int sum = 0;
    for (int j = (0); j <= (m - 1); ++j)
      if (i & (1 << j)) sum += a[j];
    if (sum > n * A) continue;
    cnt[0][sum][__builtin_popcount(i)]++;
  }
  for (int i = 0; i < (1 << (n - m)); ++i) {
    int sum = 0;
    for (int j = (0); j <= (n - m - 1); ++j)
      if (i & (1 << j)) sum += a[j + m];
    if (sum > n * A) continue;
    cnt[1][sum][__builtin_popcount(i)]++;
  }
  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) {
        if (cnt[0][k][i] && cnt[1][sum - k][j]) {
          ans += cnt[0][k][i] * cnt[1][sum - k][j];
        }
      }
    }
  printf("%lld\n", ans);
  return 0;
}
