#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
int dp[51][2510][51];
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (ll i = 0; i < (N); ++i) cin >> x[i];
  memset(dp, 0, sizeof(dp));
  dp[0][0][0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j <= 2500; j++) {
      for (int k = 0; k < i; k++) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (j + x[i - 1] <= 2500) {
          dp[i][j + x[i - 1]][k + 1] += dp[i - 1][j][k];
        }
      }
    }
  }
  ll res = 0;
  for (int k = 1; k <= 50; k++) {
    res += dp[N][k * A][k];
  }
  cout << res << endl;
}
