#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long dp[51][51][51 * 51];
int N, A, x[50], max_x = -1;
void solve() {
  dp[0][0][0] = 1;
  for (long long i = 1; i <= (long long)(50); i++)
    for (long long j = 1; j <= (long long)(50); j++)
      for (long long k = 1; k <= (long long)(50); k++) {
        if (k < x[i]) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else if (j >= 1 && k >= x[i]) {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
        } else {
          dp[i][j][k] = 0;
        }
      }
  long long ans = 0;
  for (long long k = 1; k <= (long long)(N); k++) ans += dp[N][k][k * A];
  cout << ans << endl;
}
int main() {
  cin >> N >> A;
  for (long long i = 0; i < (long long)(N); i++) {
    cin >> x[i];
    max_x = max(max_x, x[i]);
  }
  solve();
  return 0;
}
