#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> cards(n + 1);
  ll maxsum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> cards[i];
    maxsum += cards[i];
  }
  vector<vector<vector<int>>> dp(
      n + 1, vector<vector<int>>(n + 1, vector<int>(maxsum + 1, 0)));
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      for (int sum = 0; sum <= maxsum; sum++) {
        if (i == 0) {
          if (j == 0) {
            dp[i][j][sum] = (sum == 0) ? 1 : 0;
          }
        } else {
          if (sum < cards[i]) {
            dp[i][j][sum] = dp[i - 1][j][sum];
          } else {
            if (j == 0) {
              dp[i][j][sum] = (sum == 0) ? 1 : 0;
            } else {
              dp[i][j][sum] =
                  dp[i - 1][j][sum] + dp[i - 1][j - 1][sum - cards[i]];
            }
          }
        }
      }
    }
  }
  ll ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[n][i][i * a];
  }
  cout << ans << endl;
}
