#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
int main() {
  int N;
  cin >> N;
  ;
  int A;
  cin >> A;
  ;
  vector<int> x(N);
  int max_X = 0;
  for (int i = (0); i < (N); ++i) {
    cin >> x[i];
    max_X = max(max_X, x[i]);
  }
  vector<vvll> dp(N + 2, vvll(N + 10, vll(N * max_X + 10, 0)));
  dp[0][0][0] = 1;
  for (int j = 1; j <= N; ++j) {
    for (int k = 0; k <= N; ++k) {
      for (int s = 0; s <= N * max_X; ++s) {
        if (j >= 1 && s < x[j - 1])
          dp[j][k][s] = dp[j - 1][k][s];
        else if (j >= 1 && k >= 1 && s >= x[j - 1])
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]];
      }
    }
  }
  ll ans = 0;
  for (int k = 1; k * A <= N * max_X; ++k) ans += dp[N][k][k * A];
  cout << ans << endl;
  return 0;
}
