#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void) {
  int N, A;
  cin >> N >> A;
  vector<ll> x(N);
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  ll dp[51][51][2501] = {0};
  dp[0][0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      for (int k = 0; k <= 250; k++) {
        if (dp[i][j][k] == -1) continue;
        dp[i + 1][j][k] += dp[i][j][k];
        if (k + x[i] <= 2500) {
          dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
        }
      }
    }
  }
  for (int k = 0; k <= 10; k++) {
  }
  ll ans = 0;
  for (int j = 1; j <= N; j++) {
    ans += dp[N][j][j * A];
  }
  cout << ans << endl;
}
