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