#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
int N, A;
int x[50];
long long success = 0;
void dfs(int sum, int depth, int use) {
  if (depth == N) {
    if (use == 0) return;
    if (sum == use * A) success++;
    return;
  }
  dfs(sum + x[depth], depth + 1, use + 1);
  dfs(sum, depth + 1, use);
}
void solve() {
  dfs(0, 0, 0);
  printf("%lld\n", success);
}
int main() {
  scanf("%d%d", &N, &A);
  for (int i = 0; i < N; i++) {
    scanf("%d", &x[i]);
  }
  solve();
  return 0;
}
