#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long dp[55][55][2555];
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int i = 0; i < (N); ++i) cin >> x[i];
  int sum = 0;
  for (int i = 0; i < (N); ++i) sum += x[i];
  dp[0][0][0] = 1;
  for (int j = 0; j < (N + 1); ++j) {
    for (int k = 0; k < (N + 1); ++k) {
      for (int l = 0; l < (sum + 1); ++l) {
        if (j >= 1 && k >= 0 && l < x[j - 1]) {
          dp[j][k][l] = dp[j - 1][k][l];
        } else if (j >= 1 && k >= 1 && l >= x[j - 1]) {
          dp[j][k][l] = dp[j - 1][k][l] + dp[j - 1][k - 1][l - x[j - 1]];
        } else if (j == 0 && k == 0 && l == 0)
          dp[j][k][l] = 1;
        else
          dp[j][k][l] = 0;
      }
    }
  }
  long long ans = 0;
  for (int k = 1; A * k <= sum; k++) {
    ans += dp[N][k][A * k];
  }
  cout << ans << endl;
  return 0;
}
