#include <bits/stdc++.h>
using namespace std;
inline long long gi() {
  long long f = 1, sum = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = sum * 10 + ch - '0';
    ch = getchar();
  }
  return f * sum;
}
const long long N = 60;
long long dp[N][N * N], x[N], n, A;
signed main() {
  n = gi();
  A = gi();
  long long sum = 0;
  for (long long i = 1; i <= n; i++) x[i] = gi(), sum += x[i];
  dp[0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= sum; j++) dp[i][j] += dp[i - 1][j];
    for (long long j = x[i]; j <= sum; j++) dp[i][j] += dp[i - 1][j - x[i]];
  }
  long long ans = 0;
  for (long long i = 1; i * A <= sum; i++) ans += dp[n][i * A];
  printf("%lld\n", ans);
  return 0;
}
