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