#include <bits/stdc++.h>
using namespace std;
const long long maxV = 51;
long long dp[maxV][maxV][maxV * maxV];
signed main() {
  long long n, a;
  cin >> n >> a;
  vector<long long> x(n);
  for (auto&& w : x) cin >> w;
  fill(dp[0][0], dp[maxV][0], 0);
  dp[0][0][0] = 1;
  for (long long i = 0; i <= n; i++) {
    for (long long j = 0; j <= i; j++) {
      for (long long s = 0; s <= maxV * maxV; s++) {
        dp[i + 1][j][s] += dp[i][j][s];
        dp[i + 1][j + 1][s + x[i]] += dp[i][j][s];
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) ans += dp[n][i][i * a];
  cout << ans << endl;
}
