#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int M = 100000;
int main() {
  int n, a, x[50], dp[55][55][2555];
  ll ans;
  cin >> n >> a;
  for (int i = 0; i < (n); i++) cin >> x[i];
  dp[0][0][0] = 1;
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (n); j++) {
      for (int k = 0; k < (2501); k++) {
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
      }
    }
  }
  ans = 0;
  for (int i = 1; i < n + 1; i++) ans += dp[n][i][a * i];
  cout << ans << endl;
  return 0;
}
