#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1ll << 60;
ll N, A;
ll dp[55][55][255]{};
int main(int argc, char **argv) {
  cin >> N >> A;
  vector<ll> X(N);
  for (ll i = (0); i < (ll)(N); ++i) cin >> X[i];
  ***dp = 1;
  for (ll n = (0); n < (ll)(N); ++n) {
    for (ll k = (0); k < (ll)(N + 1); ++k) {
      for (ll m = (0); m < (ll)(255); ++m) {
        dp[n + 1][k][m] += dp[n][k][m];
        if (m - X[n] >= 0) dp[n + 1][k + 1][m] += dp[n][k][m - X[n]];
      }
    }
  }
  ll res{0};
  for (ll k = 1; k <= N; ++k) res += dp[N][k][A * k];
  std::cout << res << std::endl;
}
