#include <bits/stdc++.h>
using namespace std;
const long long int LINF = 2000000000000000000ll;
const int INF = 1000000100;
const long long int MOD = 1e9 + 7;
long long int ans = 0;
int n, a;
vector<int> x(55);
void dfs(int num, int sum, int id, bool ok) {
  if (ok) {
    if (sum % num == 0 && sum / num == a) {
      ans++;
      ok = false;
    }
  }
  if (id >= n) return;
  dfs(num + 1, sum + x[id], id + 1, true);
  dfs(num, sum, id + 1, ok);
}
int main() {
  cin >> n >> a;
  x.resize(n);
  for (int i = 0; i < (n); ++i) cin >> x[i];
  dfs(0, 0, 0, false);
  cout << ans << endl;
  return 0;
}
