#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const long long INF = 10010001010;
const int inf = 1000034000;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  int N, A;
  cin >> N >> A;
  long long ans = 0;
  vector<int> X(N);
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  for (int bit = 0; bit < (1 << N); ++bit) {
    int ave = 0;
    int count = 0;
    for (int i = 0; i < N; ++i) {
      if ((bit >> i) & 1) {
        ave += X[i];
        count++;
      }
    }
    double c = (double)ave / count;
    if (count != 0) {
      if (c == A && c == ceil(c)) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}
