#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a;
  cin >> a;
  vector<int> x(n, 0);
  for (long long int i = 0; i < (long long int)n; i++) cin >> x[i];
  int kmax = n * a;
  vector<vector<vector<long long int>>> dp(
      n + 1,
      vector<vector<long long int>>(n + 1, vector<long long int>(kmax + 1, 0)));
  for (long long int i = 0; i < (long long int)n + 1; i++) {
    for (long long int j = 0; j < (long long int)n + 1; j++) {
      dp[i][j][0] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++) {
      for (int k = 1; k <= kmax; 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]];
        }
      }
    }
  }
  long long int ans = 0;
  for (long long int j = 0; j < (long long int)n + 1; j++) {
    if (j == 0) continue;
    ans += dp[n][j][j * a];
  }
  cout << ans << endl;
}
