#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
const int mod = 1e9 + 7;
const int INF = 2e9;
const int MAX = 1e6;
int main() {
  int n, a;
  cin >> n >> a;
  vi x(n + 1);
  for (int i = 0; i < n + 1; i++) {
    if (i > 0) cin >> x[i];
  }
  int dp[n + 1][n + 1][50 * n];
  for (int i = 0; i < n + 1; i++) {
    for (int j = 0; j < n + 1; j++) {
      for (int k = 0; k < 50 * n + 1; k++) {
        if (i == 0 and j == 0 and k == 0) {
          dp[i][j][k] = 1;
        } else if (i >= 1 and k < x[i]) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else if (i >= 1 and j >= 1 and 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 sum = 0;
  for (int i = 0; i < n + 1; i++) {
    if (i > 0) sum += dp[n][i][i * a];
  }
  cout << sum << endl;
}
