#include <bits/stdc++.h>
using namespace std;
const constexpr int INF = 1e9;
long long N, A;
string S, T;
int dp[51][51][25510];
int a[51];
void solve() {
  for (int i = 0; i < N; ++i) cin >> a[i];
  dp[0][0][0] = 1;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      for (int k = 0; k < N * A; ++k) {
        if (k + a[i] <= A * N) dp[i + 1][j + 1][k + a[i]] += dp[i][j][k];
        dp[i + 1][j][k] += dp[i][j][k];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= N; ++i) {
    ans += dp[N][i][i * A];
  }
  cout << ans << endl;
}
int main() {
  cin >> N >> A;
  solve();
  return 0;
}
