#include <bits/stdc++.h>
using namespace std;
const int N = 25000;
const int iinf = INT_MAX / 2;
const long long linf = LLONG_MAX / 2;
const int MOD = 1e9 + 7;
inline int read() {
  int X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
void print(int x) {
  cout << x << '\n';
  exit(0);
}
void douout(double x) { printf("%lf\n", x + 0.0000000001); }
long long n, m, x, y, k, num[110], h, dp[N], cnt, d2[N], ans;
int main() {
  long long i, j;
  cin >> n >> k;
  for (i = 1; i <= n; i++) scanf("%lld", &num[i]);
  sort(num + 1, num + n + 1);
  dp[0] = d2[0] = 1;
  for (i = 1; num[i] < k && i <= n; i++) {
    num[i] = k - num[i];
    for (j = 3000; j >= num[i]; j--) dp[j] += dp[j - num[i]];
  }
  for (; num[i] == k && i <= n; i++) cnt++;
  for (; i <= n; i++) {
    num[i] -= k;
    for (j = 3000; j >= num[i]; j--) d2[j] += d2[j - num[i]];
  }
  for (i = 0; i <= 3000; i++) ans += dp[i] * d2[i] * (1ll << cnt);
  cout << ans - 1;
}
