#include <bits/stdc++.h>
using namespace std;
const int INFINT = 1 << 30;
const long long INFLL = 1LL << 60;
const double EPS = 1e-10;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const int MAX_N = 50, MAX_A = 50;
int N, A;
int x[MAX_N + 1];
long long dp[MAX_N + 1][MAX_N + 1][MAX_N * MAX_A + 1];
int main() {
  cin >> N >> A;
  for (int i = (1); i <= (N); ++i) cin >> x[i];
  for (int i = (1); i <= (N); ++i) dp[i][0][0] = 1;
  for (int i = (1); i <= (N); ++i) {
    for (int j = (1); j <= (i); ++j) {
      for (int k = (1); k <= (N * A); ++k) {
        if (j < x[i]) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
        }
      }
    }
  }
  long long ans = 0;
  for (int j = (1); j <= (N); ++j) {
    ans += dp[N][j][j * A];
  }
  cout << ans << endl;
  return 0;
}
