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