#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int N, A;
vector<int> X;
vector<int> C;
vector<bool> F;
long long Ans;
bool dfs(int i, int sum, int pick) {
  if (i == X.size()) {
    if (pick != 0 && sum == pick * A) {
      Ans++;
    }
    return false;
  }
  if (dfs(i + 1, sum, pick)) return true;
  if (dfs(i + 1, sum + X[i], pick + 1)) return true;
  return false;
}
signed main() {
  cin >> N >> A;
  X = vector<int>(N);
  C = vector<int>(N, 0);
  F = vector<bool>(N, false);
  for (int i = 0; i < N; ++i) cin >> X[i];
  Ans = 0;
  dfs(0, 0, 0);
  cout << Ans << endl;
  return 0;
}
