#include <bits/stdc++.h>
using namespace std;
int main() {
  int32_t n, a;
  cin >> n >> a;
  int32_t x[n];
  for (int32_t i = 0; i < n; i++) {
    cin >> x[i];
  }
  int32_t dp[n][n + 1][50 * n + 1];
  for (int32_t i = 0; i < n; i++) {
    for (int32_t j = 0; j <= n; j++) {
      for (int32_t k = 0; k <= 50 * n; k++) {
        if (j == 0) {
          dp[i][j][k] = k == 0 ? 1 : 0;
        } else if (i == 0) {
          dp[i][j][k] = j == 1 && k == x[0] ? 1 : 0;
        } else if (k < x[i]) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else {
          dp[i][j][k] = dp[i - 1][j - 1][k - x[i]] + dp[i - 1][j][k];
        }
      }
    }
  }
  int64_t answer = 0;
  for (int32_t j = 1; j <= n; j++) {
    answer += dp[n - 1][j][j * a];
  }
  cout << answer << endl;
}
