#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int N, A;
vector<int> x(51);
vector<vector<ll>> dp(51, vector<ll>(50 * 50 * 2 + 1, -1));
ll calc(int index, int sum) {
  if (dp[index][sum] > -1) return dp[index][sum];
  if (sum < 0 || sum > 2 * A * N) return 0;
  if (index == 0) {
    if (sum - A * N == 0)
      return 1;
    else
      return 0;
  }
  dp[index][sum] = calc(index - 1, sum) + calc(index - 1, sum - x[index]);
  return dp[index][sum];
}
int main() {
  cin >> N >> A;
  for (int i = 1; i <= N; i++) {
    int temp;
    cin >> temp;
    x[i] = temp - A;
  }
  cout << (calc(N, A * N) - 1) << "\n";
  return 0;
}
