#include <bits/stdc++.h>
using namespace std;
long long numways_makeave(const vector<long long> &cards, long long ave) {
  int n = cards.size();
  long long x = ave;
  vector<long long> y(n);
  int i;
  for (i = 0; i < n; i++) {
    y[i] = cards[i] - ave;
    if (cards[i] > x) x = cards[i];
  }
  vector<vector<long long> > dp(2, vector<long long>(2 * n * x + 1));
  int j, t;
  dp[0][n * x] = 1;
  for (j = 1; j <= n; j++)
    for (t = 0; t <= 2 * n * x; t++)
      if (t - y[j - 1] >= 0 && t - y[j - 1] <= 2 * n * x) {
        dp[j & 1][t] = dp[j & 1 ^ 1][t] + dp[j & 1 ^ 1][t - y[j & 1 ^ 1]];
      } else {
        dp[j & 1][t] = dp[j & 1 ^ 1][t];
      }
  return dp[n & 1][n * x] - 1LL;
}
int main(void) {
  int n;
  long long a;
  cin >> n >> a;
  vector<long long> x(n);
  int i;
  for (i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
  }
  cout << numways_makeave(x, a) << endl;
  return 0;
}
