#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 4 * atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-6;
const string YES = "Possible";
const string NO = "Impossible";
const int MAX_N = 51;
int N, A;
ll dp[MAX_N][MAX_N][MAX_N * MAX_N];
int input[MAX_N];
void solve() {
  dp[0][0][0] = 1;
  for (int i = 1; i <= N; ++i)
    for (int j = 0; j <= i; ++j) {
      for (int k = 0; k <= 2500; ++k) {
        if (!k)
          dp[i][j][k] = 1;
        else {
          if (j != i) dp[i][j][k] += dp[i - 1][j][k];
          if (k >= input[i - 1] && j >= 1)
            dp[i][j][k] += dp[i - 1][j - 1][k - input[i - 1]];
        }
      }
    }
  ll ans = 0;
  for (int n = 1; n <= N; ++n)
    for (int sum = 0; sum <= 2500; ++sum) {
      if ((double)sum / n == (double)A) ans += dp[N][n][sum];
    }
  cout << ans << endl;
}
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; ++i) cin >> input[i];
  solve();
  return 0;
}
