#include <bits/stdc++.h>
int D = 1;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> v(n);
  for (int i = (int)0; i < (int)n; i++) cin >> v[i];
  vector<vector<vector<int>>> dp(51,
                                 vector<vector<int>>(51, vector<int>(2501, 0)));
  dp[0][0][0] = 1;
  for (int i = (int)0; i < (int)n; i++) {
    for (int j = (int)0; j < (int)n; j++) {
      for (int k = (int)0; k < (int)2501; k++) {
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i + 1][j + 1][k + v[i]] += dp[i][j][k];
      }
    }
  }
  long long int ans = 0;
  for (int j = (int)1; j < (int)n; j++) {
    for (int k = (int)1; k < (int)2501; k++) {
      if (k % j == 0 && k / j == a) ans += dp[n][j][k];
    }
  }
  cout << ans << endl;
  return 0;
}
