#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
inline long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
inline long long lcm(long long a, long long b) { return a * b / GCD(a, b); }
template <class T>
bool contain(const std::string& s, const T& v) {
  return s.find(v) != std::string::npos;
}
using Edge = pair<int, long long>;
using Graph = vector<vector<long long>>;
int dp[55][3555][55];
int main() {
  int n, a;
  cin >> n >> a;
  vector<long long> x(n);
  for (long long i = 0; i < (long long)n; i++) cin >> x[i];
  memset(dp, 0, sizeof(dp));
  dp[0][0][0] = 1;
  for (long long i = 0; i < (long long)n; i++) {
    for (int s = 0; s <= n * a; s++) {
      for (int k = 0; k <= n; k++) {
        dp[i + 1][s][k] += dp[i][s][k];
        dp[i + 1][s + x[i]][k + 1] += dp[i][s][k];
      }
    }
  }
  long long res = 0;
  for (int k = 1; k <= n; k++) res += dp[n][a * k][k];
  cout << res << endl;
}
