#include <bits/stdc++.h>
using namespace std;
const int N = 60, N2 = 2510;
long long n, a, x[N], dp[N][N][N2], res;
void solve() {
  cin >> n >> a;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int j = 0; j <= n; j++) {
    for (int k = 0; k <= N; k++) {
      dp[0][j][k] = 0;
    }
  }
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k <= N; k++) {
        if (j == 0) {
          dp[i][j][k] = dp[i - 1][j][k];
          continue;
        }
        dp[i][j][k] = dp[i - 1][j][k];
        if (k >= x[i]) dp[i][j][k] += dp[i - 1][j - 1][k - x[i]];
      }
    }
  }
  res = 0;
  for (int i = 1; i <= n; i++) {
    res += dp[n][i][i * a];
  }
  cout << res << "\n";
}
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
