#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n + 5);
  vector<vector<vector<int>>> dat(60,
                                  vector<vector<int>>(60, vector<int>(3000)));
  for (int i = 0; i < (n); i++) cin >> x[i + 1];
  dat[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k <= 3000; k++) {
        dat[i][j][k] += dat[i - 1][j][k];
        if (j >= 1 && k - x[i] >= 0)
          dat[i][j][k] += dat[i - 1][j - 1][k - x[i]];
      }
    }
  }
  ll ans = 0;
  for (int k = 1; k <= n; k++) {
    ans += dat[n][k][k * a];
  }
  cout << ans;
}
