#include <bits/stdc++.h>
using namespace std;
int N, A;
vector<int> x(50);
long long int ans = 0;
void dfs(int p, int c, int sum, bool update) {
  if (update && A * c == sum) ans++;
  if (p >= N) return;
  dfs(p + 1, c + 1, sum + x[p], 1);
  dfs(p + 1, c, sum, 0);
}
void solve() {
  dfs(0, 0, 0, 0);
  cout << ans << endl;
}
int main() {
  cin >> N >> A;
  for (int i = 0; i < (int)N; i++) {
    cin >> x[i];
  }
  solve();
  return 0;
}
