#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long A;
  cin >> n >> A;
  long long x[n];
  for (auto& y : x) {
    cin >> y;
  }
  long long dp[n + 1][51 * n + 1];
  for (int i = 0; i < n + 1; i++) {
    for (auto& y : dp[i]) y = 0;
  }
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 51 * n - x[i]; j++) {
      dp[i + 1][j] += dp[i][j];
      dp[i + 1][j + x[i]] += dp[i][j];
    }
  }
  cout << dp[n][A * n] << endl;
  return 0;
}
