#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int i = 0; i < N; i++) cin >> x[i];
  vector<vector<vector<int>>> dp(
      N + 1, vector<vector<int>>(N + 1, vector<int>(50 * 50 + 1, 0)));
  for (int i = 0; i <= N; i++) {
    for (int j = 0; j <= N; j++) {
      for (int k = 0; k <= 50 * 50; k++) {
        if (i == 0 && j == 0 && k == 0) dp[0][0][0]++;
        if (i - 1 >= 0 && k - x[i - 1] < 0) dp[i][j][k] = dp[i - 1][j][k];
        if (i - 1 >= 0 && j - 1 >= 0 && k - x[i - 1] >= 0)
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i - 1]];
      }
    }
  }
  ll ans = 0;
  for (int j = 1; j <= N; j++) {
    ans += dp[N][j][A * j];
  }
  cout << ans << endl;
  return 0;
}
