#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = INT_MAX / 2 - 1;
const double EPS = 1e-9;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
int main() {
  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>(n * a + 1, 0)));
  for (int i = 0; i < n + 1; i++) dp[0][i][0] = 1;
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < n + 1; j++) {
      for (int k = 0; k < n * a + 1; k++) {
        if (k - x[j - 1] >= 0)
          dp[i][j][k] = dp[i][j - 1][k] + dp[i - 1][j - 1][k - x[j - 1]];
        else
          dp[i][j][k] = dp[i][j - 1][k];
      }
    }
  }
  long long res = 0;
  for (int i = 0; i < n; i++) res += dp[i + 1][n][a * (i + 1)];
  cout << res << endl;
  return 0;
}
