#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int M = 100000;
int main() {
  int n, a, x[50];
  cin >> n >> a;
  for (int i = 0; i < (n); i++) cin >> x[i];
  int ans = 0;
  for (int bit = 0; bit < (1 << n); bit++) {
    if (!bit) continue;
    int sum = 0;
    int num = 0;
    for (int i = 0; i < n; i++) {
      if (bit & (1 << i)) {
        sum += x[i];
        num++;
      }
    }
    if (sum == (a * num)) {
      ans++;
    }
  }
  cout << ans << endl;
}
