#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int INF = 1 << 20;
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  long long ans = 0;
  for (int bit = 0; bit < (1 << n); bit++) {
    long long sum = 0;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (bit & (1 << i)) {
        cnt++;
        sum += x[i];
      }
    }
    if (cnt * a == sum && cnt != 0) ans++;
  }
  cout << ans << endl;
}
