#include <bits/stdc++.h>
using namespace std;
long long mexp(long long a, long long b) {
  long long ans = 1;
  a %= 1000000007;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    b >>= 1;
    a = a * a % 1000000007;
  }
  return ans;
}
int n, x;
int a[51];
int dp[51][51][2501];
int solve(int ind, int num, int rem) {
  if (num == 0) {
    if (rem == 0) {
      return 1;
    } else {
      return 0;
    }
  }
  if (ind > n) {
    return 0;
  }
  if (rem < 0) {
    return 0;
  }
  if (dp[ind][num][rem] != -1) {
    return dp[ind][num][rem];
  }
  dp[ind][num][rem] =
      solve(ind + 1, num, rem) + solve(ind + 1, num - 1, rem - a[ind]);
  return dp[ind][num][rem];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x;
  for (long long i = 1; i < n + 1; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < 51; ++i) {
    for (long long j = 0; j < 51; ++j) {
      for (long long k = 0; k < 2501; ++k) {
        dp[i][j][k] = -1;
      }
    }
  }
  int ans = 0;
  for (long long i = 1; i < n + 1; ++i) {
    ans += solve(1, i, i * x);
  }
  cout << ans;
  cerr << "Time: " << 1.0 / CLOCKS_PER_SEC << " ms" << endl;
  return 0;
}
