#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const int MAX = 510000;
const long long MOD = 1000000007;
int main() {
  long long n, a;
  cin >> n >> a;
  vector<long long> x(n);
  for (long long i = (0); i < (n); ++i) cin >> x[i];
  vector<vector<vector<long long> > > dp(
      51, vector<vector<long long> >(50, vector<long long>(2510, 0)));
  for (long long i = (0); i < (n + 1); ++i) {
    dp[i][0][0] = 1;
  }
  for (long long i = (1); i < (n + 1); ++i) {
    for (long long j = (1); j < (i + 1); ++j) {
      for (long long k = (0); k < (2510); ++k) {
        if (k < x[i - 1]) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i - 1]];
        }
      }
    }
  }
  long long ans = 0;
  for (long long i = (1); i < (n + 1); ++i) {
    ans += dp[n][i][i * a];
  }
  cout << (ans) << endl;
  ;
}
