#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const int mod = 1e9 + 7;
const int INF = 1001001001;
int64_t dp[55][500][55];
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  for (int i = 0; i <= N; i++) {
    for (int j = 0; j <= 500; j++) {
      for (int k = 0; k <= N; k++) {
        dp[i][j][k] = 0;
      }
    }
  }
  dp[0][0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j <= N * A; j++) {
      for (int k = 0; k <= N; k++) {
        if (dp[i][j][k] == 0) {
          continue;
        }
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i + 1][j + x[i]][k + 1] += dp[i][j][k];
      }
    }
  }
  int64_t cnt = 0;
  for (int k = 1; k <= N; k++) {
    cnt += dp[N][k * A][k];
  }
  cout << cnt << endl;
  return 0;
}
