#include <bits/stdc++.h>
using namespace std;
const long long int N = 500000;
bool prime[N];
void sieve() {
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p < 100000000; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i < 100000; i += p) prime[i] = false;
    }
  }
}
long long int nxt() {
  long long int x;
  cin >> x;
  return x;
}
long long int k;
long long int average(long long int i, long long int sum, long long int cnt,
                      long long int a[], long long int n) {
  if (i == n) {
    if (cnt > 0 && sum % cnt == 0 && sum / cnt == k)
      return 1;
    else
      return 0;
  }
  long long int ans = 0;
  ans += average(i + 1, sum, cnt, a, n);
  ans += average(i + 1, sum + a[i], cnt + 1, a, n);
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long int n = nxt();
  k = nxt();
  long long int arr[n];
  generate(arr, arr + n, nxt);
  cout << average(0, 0, 0, arr, n);
  return 0;
}
