#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
int N, A;
vector<int> x;
int main() {
  cin >> N >> A;
  x.resize(N);
  for (auto &v : x) cin >> v;
  vector<vector<lint> > n1(26, vector<lint>(50 * 25 + 1));
  vector<vector<lint> > n2(26, vector<lint>(50 * 25 + 1));
  for (int i = 0; i < (1 << (N / 2)); i++) {
    int tmp = 0;
    for (int j = 0; j < N / 2; j++)
      if ((i >> j) & 1) tmp += x[j];
    n1[__builtin_popcount(i)][tmp]++;
  }
  for (int i = 0; i < (1 << (N - N / 2)); i++) {
    int tmp = 0;
    for (int j = 0; j < N - N / 2; j++)
      if ((i >> j) & 1) tmp += x[N / 2 + j];
    n2[__builtin_popcount(i)][tmp]++;
  }
  lint ans = 0;
  for (int i = 0; i <= N / 2; i++) {
    for (int j = 0; j <= N - N / 2; j++) {
      if (i == 0 && j == 0) continue;
      for (int k = 0; k <= (i + j) * A; k++) {
        lint t = n1[i][k] * n2[j][(i + j) * A - k];
        ans += t;
      }
    }
  }
  cout << ans << endl;
}
