#include <bits/stdc++.h>
using namespace std;
int n, k;
long long ans = 0;
int f[100005], a[100005];
void nhiphan(int i) {
  if (i > n) {
    int cnt = 0, s = 0;
    for (int j = 1; j <= n; ++j)
      if (f[j]) s += a[j], ++cnt;
    if (!s || !cnt) return;
    if (k * cnt == s) ++ans;
    return;
  }
  for (int j = 0; j <= 1; ++j) {
    f[i] = j;
    nhiphan(i + 1);
  }
}
int main() {
  scanf("%d %d", &n, &k);
  if (n <= 16) {
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    nhiphan(1);
    cout << ans;
  } else
    puts("0");
  return 0;
}
