#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<long long> xs(N, 0);
  for (int(i) = 0; (i) < (N); (i)++) {
    cin >> xs[i];
  }
  int size = N * A + (50 - A) * N;
  vector<vector<long long>> dp(N + 1, vector<long long>(size, 0));
  dp[0][N * A] = 1;
  for (int(i) = 0; (i) < (N); (i)++) {
    for (int(j) = 0; (j) < (size); (j)++) {
      dp[i + 1][j] += dp[i][j];
      if (j + xs[i] - A >= 0) {
        dp[i + 1][j + xs[i] - A] += dp[i][j];
      }
    }
  }
  cout << dp[N][N * A] - 1 << endl;
  return 0;
}
