#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 7;
const long long INF = 1e18;
int n, a, x[N];
long long dp[51][51][2505], sum;
int main() {
  scanf("%d %d", &n, &a);
  for (int i = 1; i <= n - 1; ++i) scanf("%d", x + i), sum += x[i];
  dp[0][0][0] = 1;
  for (int i = 0; i <= n - 1; ++i) {
    for (int j = 0; j <= n - 1; ++j) {
      for (int k = 0; k <= sum; ++k) {
        if (k + x[i] <= sum) dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
        dp[i + 1][j][k] += dp[i][j][k];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int k = 0; k <= sum; ++k) {
      if (k == a * i) ans += dp[n][i][k];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
