#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, a;
  cin >> n >> a;
  vector<long long> x(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> x[i];
  static long long dp[51][51][2600];
  for (long long i = 0; i < (long long)(51); i++)
    for (long long j = 0; j < (long long)(51); j++)
      for (long long k = 0; k < (long long)(2600); k++) dp[i][j][k] = 0;
  dp[0][0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < (long long)(51); j++) {
      for (long long k = 0; k < (long long)(3000); k++) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (k - x[i - 1] >= 0 && j - 1 >= 0)
          dp[i][j][k] += dp[i - 1][j - 1][k - x[i - 1]];
      }
    }
  }
  long long ans = 0;
  for (long long j = 1; j <= n; j++) {
    ans += dp[n][j][j * a];
  }
  cout << ans << endl;
}
