#include <bits/stdc++.h>
using namespace std;
int N, A, x[52];
long long int ans = 0;
void solve(int sum, int n, int d) {
  if (d == N) {
    if (n > 0 && sum % n == 0 && sum / n == A) ans++;
    return;
  }
  solve(sum, n, d + 1);
  solve(sum + x[d + 1], n + 1, d + 1);
  return;
}
int main() {
  cin >> N >> A;
  for (int i = 1; i <= N; i++) {
    cin >> x[i];
  }
  solve(0, 0, 0);
  cout << ans << endl;
  return 0;
}
