#include <bits/stdc++.h>
using namespace std;
int const N = 55;
int n;
double A;
int a[N];
void small() {
  int ans = 0;
  for (int mask = 0; mask < (1 << n); mask++) {
    double soma = 0;
    double cnt = 0;
    for (int i = 0; i < n; i++)
      if ((1 << i) & mask) {
        cnt++;
        soma += a[i];
      }
    if ((soma / cnt) == A) ans++;
  }
  printf("%d\n", ans);
}
long long dp[N * N][N][N];
long long get(int V, int total, int pos) {
  if (V < 0) return 0LL;
  if (!V) return 1LL;
  if (pos >= n) return 0LL;
  if (!total) return 0LL;
  if (dp[V][total][pos] != -1LL) return dp[V][total][pos];
  dp[V][total][pos] =
      get(V - a[pos], total - 1, pos + 1) + get(V, total, pos + 1);
  return dp[V][total][pos];
}
void large() {
  int V = (int)(A);
  memset(dp, -1LL, sizeof(dp));
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += get(i * V, i, 0);
  cout << ans << '\n';
}
void solve() {
  if (n <= 16) {
    small();
    return;
  }
  large();
}
int main() {
  cin >> n >> A;
  for (int i = 0; i < n; i++) cin >> a[i];
  solve();
  return 0;
}
