#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
int dp[55][55][2550];
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int i = (int)(0); i < (int)(N); i++) cin >> x[i];
  dp[0][0][0] = 1;
  for (int i = (int)(0); i < (int)(N); i++)
    for (int j = (int)(0); j < (int)(i + 2); j++)
      for (int k = (int)(0); k < (int)(2550); k++) {
        if (j >= 1 && k - x[i] >= 0) dp[i + 1][j][k] += dp[i][j - 1][k - x[i]];
        dp[i + 1][j][k] += dp[i][j][k];
      }
  ll ans = 0;
  for (int j = (int)(1); j < (int)(N + 1); j++)
    for (int k = (int)(0); k < (int)(2550); k++) {
      if (k % j == 0 && k / j == A) ans += dp[N][j][k];
    }
  cout << ans << endl;
}
