#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VL = vector<ll>;
const long long INF = 999999999;
ll N, A, x[60];
int main() {
  cin >> N >> A;
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  for (int i = 1; i < (1 << N); i++) {
    int sum = 0;
    int count = 0;
    for (int j = 0; j < N; j++) {
      if (i & (1 << j)) {
        sum += x[j];
        count++;
      }
    }
    if (sum == count * A) {
      ans++;
    }
  }
  cout << ans << endl;
}
