#include <bits/stdc++.h>
using namespace std;
void possibleWays(vector<int> &arr, int &res, int a, int idx, int &sum,
                  int &c) {
  if (c && (sum == a * c)) res++;
  for (int i = idx; i < arr.size(); i++) {
    sum += arr[i];
    c++;
    possibleWays(arr, res, a, i + 1, sum, c);
    sum -= arr[i];
    c--;
  }
}
int main() {
  int n, a, i, j;
  cin >> n >> a;
  vector<int> arr(n);
  for (i = 0; i < n; i++) cin >> arr[i];
  int res = 0, sum = 0, c = 0;
  i = 0;
  possibleWays(arr, res, a, i, sum, c);
  cout << res;
}
