#include <bits/stdc++.h>
using namespace std;
using i32 = int32_t;
using i64 = int64_t;
using f64 = double_t;
using str = string;
template <typename T>
using vec = vector<T>;
template <typename T>
using heap = priority_queue<T, vec<T>, greater<T>>;
const i64 MOD = 1000000007;
i32 n, a;
i32 x[50];
i64 rec(i32 i, i64 v, i64 c) {
  if (i == n) {
    if (c == 0) return 0;
    return ((v % c == 0) && (v / c == a)) ? 1 : 0;
  }
  return rec(i + 1, v + x[i], c + 1) + rec(i + 1, v, c);
}
i32 main() {
  cin >> n >> a;
  if (n > 16) return 0;
  for (i32 i = 0; i < (n); ++i) {
    cin >> x[i];
  }
  cout << rec(0, 0, 0) << endl;
  return 0;
}
