#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
inline int std_in(int& a) { return scanf("%d", &a); }
auto pint_compare = [](pint x, pint y) -> bool { return (x.first < y.first); };
const int MOD = 1000000007;
const int MAX_N = 50, MAX_X = 50;
int N, A, x[MAX_N];
ll dp[MAX_N + 1][MAX_N * MAX_X + 1][MAX_N];
ll solve() {
  for (int(i) = 0; (i) < (N + 1); ++(i)) dp[0][0][0] = 1;
  for (int(i) = 0; (i) < (N); ++(i)) {
    for (int(j) = 0; (j) < (N * MAX_X + 1); ++(j)) {
      for (int(k) = 0; (k) < (N + 1); ++(k)) {
        dp[i + 1][j][k] += dp[i][j][k];
        if (j + x[i] > N * MAX_X) continue;
        dp[i + 1][j + x[i]][k + 1] += dp[i][j][k];
      }
    }
  }
  ll ret = 0;
  for (int(k) = (1); (k) < (N + 1); ++(k)) ret += dp[N][k * A][k];
  return ret;
}
signed main() {
  cin >> N >> A;
  for (int(i) = 0; (i) < (N); ++(i)) cin >> x[i];
  cout << (solve()) << "\n";
  return 0;
}
