#include <bits/stdc++.h>
using namespace std;
constexpr int kMod = 1000000007;
template <typename T>
istream& operator>>(istream& is, vector<T>& vs) {
  for (T& v : vs) is >> v;
  return is;
}
int N, A;
vector<int> x;
int dfs(int i, int sum, int cnt) {
  if (i >= N) {
    if (cnt == 0)
      return 0;
    else
      return (sum == A * cnt);
  }
  return dfs(i + 1, sum, cnt) + dfs(i + 1, sum + x[i], cnt + 1);
}
int main() {
  cin >> N >> A;
  x.resize(N);
  cin >> x;
  cout << dfs(0, 0, 0) << endl;
}
