#include <bits/stdc++.h>
using namespace std;
const static long long MOD = 1e9 + 7;
const static long long INF = 1 << 30;
long long a, b, c, d, k, l, m, n, h, w, q, x, y;
string s, t;
long long ans = 0;
long long sum = 0;
long long cnt = 0;
long long tmp = 0;
long long mini = INF;
long long maxi = 0;
double ave = 0.0;
int main() {
  unsigned long long n, a;
  cin >> n >> a;
  vector<unsigned long long> x(n);
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  cout << fixed << setprecision(0) << (1ull << 33ull) << endl;
  for (unsigned long long bit = 0; bit < (1ull << n); ++bit) {
    vector<unsigned long long> s;
    for (unsigned long long i = 0; i < n; ++i) {
      if (bit & (1ull << i)) {
        s.push_back(i);
      }
    }
    sum = 0;
    cnt = 0;
    for (auto &&i : s) {
      sum += x[i];
      cnt++;
    }
    if (((double)sum / cnt) == a) ans++;
  }
  cout << ans << endl;
}
