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