#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> X(N);
  for (int i = (int)(0); i < (int)(N); ++i) cin >> X[i];
  vector<vector<int>> dp(N + 1, vector<int>(2501, 0));
  dp[0][0] = 1;
  for (int i = (int)(0); i < (int)(N); ++i) {
    auto dp_ = dp;
    int x = X[i];
    for (int j = (int)(0); j < (int)(N); ++j)
      for (int k = (int)(0); k < (int)(2501); ++k)
        if (k + x < 2501) {
          dp_[j + 1][k + x] += dp[j][k];
        }
    dp = dp_;
  }
  long long int ans = 0LL;
  for (int i = (int)(1); i < (int)(N + 1); ++i) ans += dp[i][i * A];
  cout << ans << endl;
  return 0;
}
