#include <bits/stdc++.h>
using namespace std;
const long long dx[] = {0, -1, 0, 1};
const long long dy[] = {1, 0, -1, 0};
const long long MOD = (998244353);
const long long INF = (1LL << 60) - 1;
const double EPS = (1 >> 30);
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  long long n, a;
  cin >> n >> a;
  vector<long long> x(n);
  sort((x).rbegin(), (x).rend());
  long long X = max(a, x[0]);
  for (long long i = 0; i < n; i++) cin >> x[i];
  long long dp[55][55][2505] = {};
  for (long long j = 0; j <= n; j++) {
    for (long long k = 0; k <= n; k++) {
      for (long long s = 0; s <= n * X; s++) {
        if (j == 0 && k == 0 && s == 0) {
          dp[j][k][s] = 1;
        } else if (j >= 1 && s < x[j]) {
          dp[j][k][s] = dp[j - 1][k][s];
        } else if (j >= 1 && k >= 1 && s >= x[j]) {
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
        } else {
          dp[j][k][s] = 0;
        }
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans += dp[n][i][i * a];
  }
  cout << ans << endl;
}
