#include <bits/stdc++.h>
using namespace std;
const long long INF = 1145141919;
const long long MOD = 1000000007;
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
  }
}
template <class T>
void chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
  }
}
long long N, A;
long long X[50];
long long ans = 0;
void dfs(long long idx, long long num, long long sum) {
  if (idx == N) return;
  dfs(idx + 1, num, sum);
  num++;
  sum += X[idx];
  if (num * A == sum) ans++;
  dfs(idx + 1, num, sum);
}
int main() {
  cin >> N >> A;
  for (long long(i) = 0; (i) < (N); (i)++) cin >> X[i];
  dfs(0, 0, 0);
  cout << ans << endl;
  return 0;
}
