#include <bits/stdc++.h>
using namespace std;
long long n, k, a[110], dp[2510], cnt, ans, d[2510];
int main() {
  long long i, j;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + n + 1);
  dp[0] = d[0] = 1;
  for (i = 1; a[i] < k && i <= n; i++) {
    a[i] = k - a[i];
    for (j = 3000; j >= a[i]; j--) {
      dp[j] += dp[j - a[i]];
    }
  }
  for (; a[i] == k && i <= n; i++) cnt++;
  for (; i <= n; i++) {
    a[i] -= k;
    for (j = 3000; j >= a[i]; j--) {
      d[j] += d[j - a[i]];
    }
  }
  for (i = 0; i <= 3000; i++) {
    ans += dp[i] * d[i] * (1ll << cnt);
  }
  printf("%lld", ans - 1);
  return 0;
}
