#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a;
  cin >> n >> a;
  vector<long long int> num;
  long long int sum = 0;
  for (long long int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    num.push_back(a);
    sum += a;
  }
  long long int N = n;
  long long int ans = 0;
  for (long long int S = 1; S <= (static_cast<long long int>(1) << N) - 1;
       S++) {
    long long int tmp = 0;
    long long int cnt = 0;
    for (long long int i = 0; i < N; i++) {
      if (S >> i & 1) {
        tmp += num[i];
        cnt++;
      }
    }
    if (tmp == a * cnt) {
      ans += 1;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
