#include <bits/stdc++.h>
using ll = long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;
ll dp[55][55][2505];
signed 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 + 1; ++j) {
      for (int k = (int)0; k < (int)a * j + 1; ++k) {
        dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
        dp[i + 1][j][k] += dp[i][j][k];
      }
    }
  }
  ll ans = 0;
  for (int i = 1; i <= n; ++i) ans += dp[n][i][a * i];
  cout << ans << endl;
  return 0;
}
