#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int inf = 1e9;
const int mod = 1e9 + 7;
const int maxn = 5e5 + 10;
int n;
int a[55], x;
map<pair<int, int>, int> f;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int k = (n + 1) / 2;
  long long ans = 0;
  for (long long i = 0; i < (1ll << k); i++) {
    int ret = 0, cnt = 0;
    for (int j = 0; j < k; j++) {
      if ((i >> j) & 1) {
        cnt++;
        ret += a[j];
      }
    }
    f[pair<int, int>(ret, cnt)]++;
  }
  for (long long i = 0; i < (1ll << (n - k)); i++) {
    int ret = 0, cnt = 0;
    for (int j = 0; j < n - k; j++) {
      if ((i >> j) & 1) {
        cnt++;
        ret += a[j + k];
      }
    }
    for (int j = 0; j <= 26; j++) {
      int y = (j + cnt) * x - ret;
      if (y >= 0) {
        ans += f[pair<int, int>(y, j)];
      }
    }
  }
  cout << ans - 1 << endl;
  return 0;
}
