#include <bits/stdc++.h>
using namespace std;
long long N, A;
long long ans = 0;
long long x[100] = {0};
long long dp[100][100][300];
int main() {
  cin >> N >> A;
  for (long long i = 1; i <= N; ++i) {
    cin >> x[i];
  }
  for (long long j = 0; j < N + 1; ++j) {
    for (long long k = 0; k < N + 1; ++k) {
      for (long long s = 0; s < N * 50 + 1; ++s) {
        if (j == 0 && k == 0 && s == 0) {
          dp[j][k][s] = 1;
        } else if (s < x[j]) {
          dp[j][k][s] = dp[j - 1][k][s];
        } else if (k >= 1 && k <= j) {
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
        } else {
          dp[j][k][s] = 0;
        }
      }
    }
  }
  for (long long k = 1; k <= N; ++k) {
    ans += dp[N][k][k * A];
  }
  cout << ans << "\n";
}
