#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<vector<ll>>> dp(50, vector<vector<ll>>(51, vector<ll>(50 * 50 + 1,
                                                                    -1)));
ll calc(int count, int index, int sum) {
  if (sum < 0) return 0;
  if (dp[count][index][sum] > -1) return dp[count][index][sum];
  if (sum == 0) {
    if (count == 0)
      return 1;
    else
      return 0;
  }
  if (index == 1) {
    if (count == 1 && sum == x[1])
      return 1;
    else
      return 0;
  }
  dp[count][index][sum] =
      calc(count, index - 1, sum) + calc(count - 1, index - 1, sum - x[index]);
  return dp[count][index][sum];
}
int main() {
  cin >> N >> A;
  for (int i = 1; i <= N; i++) {
    cin >> x[i];
  }
  ll count = 0;
  for (int i = N; i > 0; i--) {
    count += calc(i, N, i * A);
  }
  cout << count << "\n";
  return 0;
}
