#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int maxd = 50 * 50 + 100;
int dp[51][51][maxd];
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 < (i + 1); ++j) {
      for (int k = 0; k < (A * N + 1); ++k) {
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
      }
    }
  }
  ll ans = 0;
  for (int k = 1; k * A <= N * 50; k++) {
    ans += dp[N][k][A * k];
  }
  cout << ans << endl;
  return 0;
}
