#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX = 50;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int& xi : x) cin >> xi;
  vector<vector<vector<ll>>> dp(
      N + 1, vector<vector<ll>>(N + 1, vector<ll>(MAX * N + 1, 0)));
  dp[0][0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < i; j++) {
      for (int k = 0; k <= i * MAX; 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 j = 1; j <= N; j++) ans += dp[N][j][j * A];
  cout << ans << endl;
  return 0;
}
