#include <bits/stdc++.h>
using namespace std;
int n, a;
vector<int> v;
long long res = 0;
void dfs(int pos, long long sum, int num) {
  if (pos == n) {
    if (num == 0) return;
    if (sum % num == 0 && sum / num == a) res++;
    return;
  }
  dfs(pos + 1, sum, num);
  sum += v[pos];
  dfs(pos + 1, sum, num + 1);
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    v.push_back(tmp);
  }
  dfs(0, 0, 0);
  cout << res << endl;
}
