#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 (int k = 0, k_len = (N + 1); k < k_len; ++k) {
    for (int s = 0, s_len = (N * 50 + 1); s < s_len; ++s) {
      dp[0][k][s] = 0;
    }
  }
  dp[0][0][0] = 1;
  for (long long j = 1; j <= N; ++j) {
    for (long long k = 0; k <= N; ++k) {
      for (long long s = 0; s <= N * 50; ++s) {
        if (s < x[j]) {
          dp[j][k][s] = dp[j - 1][k][s];
        } else if (k >= 1) {
          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";
}
