#include <bits/stdc++.h>
using namespace std;
static const long long inf = 1ll << 60;
long long N, A;
long long x[55];
long long ans;
long long mem[55][55][2500][5];
long long cal2(long long n, long long use, long long sum, bool b) {
  if (mem[n][use][sum][b] != -1) return mem[n][use][sum][b];
  long long res = 0;
  if (n == N + 1) {
    return 0;
  }
  if (use != 0 && b) {
    if ((double)sum / use == A) {
      res += cal2(n + 1, use + 1, sum + x[n], true) +
             cal2(n + 1, use, sum, false) + 1;
    } else
      res +=
          cal2(n + 1, use + 1, sum + x[n], true) + cal2(n + 1, use, sum, false);
  } else {
    res +=
        cal2(n + 1, use + 1, sum + x[n], true) + cal2(n + 1, use, sum, false);
  }
  return mem[n][use][sum][b] = res;
}
signed main() {
  cin >> N >> A;
  memset(mem, -1, sizeof(mem));
  for (long long i = 0; i < N; ++i) cin >> x[i];
  ans = cal2(0, 0, 0, true);
  cout << ans << endl;
}
