#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
vector<long long> V;
long long pre[maxn];
long long dp[55][55][5005];
int main() {
  dp[0][0][0] = 1;
  int n, a;
  cin >> n >> a;
  for (int i = 1; i <= n; i++) cin >> pre[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k <= 5000; k++) dp[i][j][k] = dp[i - 1][j][k];
      for (int k = pre[i]; k <= 5000; k++) {
        dp[i][j][k] += dp[i - 1][j - 1][k - pre[i]];
      }
    }
  }
  long long ans = 0;
  for (int j = 1; j <= n; j++) {
    for (int i = 0; i <= 5000; i++) {
      if (a * j == i) ans += dp[n][j][i];
    }
  }
  cout << ans << endl;
  return 0;
}
