#include <bits/stdc++.h>
using namespace std;
int N, A;
vector<int> x;
long long rec(int num, int val) {
  long long res = 0;
  if (num == N)
    return val == 0 ? 1 : 0;
  else
    res = rec(num + 1, val + x[num]) + rec(num + 1, val);
  return res;
}
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; i++) {
    int input;
    cin >> input;
    input -= A;
    x.push_back(input);
  }
  cout << rec(0, 0) - 1 << endl;
  return 0;
}
