#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int a;
  int x[51];
  int total = 0;
  int dp[51][51][2500] = {};
  cin >> n >> a;
  for (int i = (1); i <= (n); i++) {
    cin >> x[i];
  }
  for (int i = (0); i <= (n); i++) {
    for (int t = (0); t <= (n); t++) {
      for (int u = (0); u <= (50 * n); u++) {
        if (i == 0 && t == 0 && u == 0) {
          dp[i][t][u] = 1;
          continue;
        }
        if (i >= 1 && u < x[i]) {
          dp[i][t][u] = dp[i - 1][t][u];
          continue;
        }
        if (i >= 1 && t >= 1 && u >= x[i]) {
          dp[i][t][u] = dp[i - 1][t][u] + dp[i - 1][t - 1][u - x[i]];
          continue;
        }
        dp[i][t][u] = 0;
      }
    }
  }
  for (int i = (1); i <= (n); i++) {
    total += dp[n][i][i * a];
  }
  cout << total << endl;
  return 0;
}
