#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>(2510, 0));
  for (int i = (int)(0); i < (int)(N); ++i) {
    for (int j = N; j >= 1; --j)
      for (int k = 2500; k >= X[i]; --k) dp[j][k] += dp[j - 1][k - X[i]];
  }
  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;
}
