#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const* argv[]) {
  int n, a, i, j, k, l, xmax = 0;
  long long int ans = 0;
  cin >> n >> a;
  xmax = a;
  vector<int> x(n, 0);
  for (i = 0; i < n; i++) {
    cin >> x[i];
    if (x[i] >= xmax) xmax = x[i];
  }
  int dp[n + 1][n + 1][n * xmax + 1];
  for (j = 0; j <= n; j++) {
    for (k = 0; k <= n; k++) {
      for (l = 0; l <= n * xmax; l++) {
        if (j == 0 && k == 0 && l == 0)
          dp[j][k][l] = 1;
        else if (j >= 1 && l < x[j - 1])
          dp[j][k][l] = dp[j - 1][k][l];
        else if (j >= 1 && k >= 1 && l >= x[j - 1]) {
          dp[j][k][l] = dp[j - 1][k][l] + dp[j - 1][k - 1][l - x[j - 1]];
        } else
          dp[j][k][l] = 0;
      }
    }
  }
  for (k = 1; k <= n; k++) {
    ans += dp[n][k][k * a];
  }
  cout << ans << endl;
  return 0;
}
