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