#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (auto i = begin(v); i != end(v); i++)
    os << *i << (i == end(v) - 1 ? "" : " ");
  return os;
}
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto i = begin(v); i != end(v); i++) is >> *i;
  return is;
}
int left_side[1000000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a;
  cin >> n >> a;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    vec[i] -= a;
  }
  if (n == 1) {
    int cnt = 0;
    for (int i = 0; i < n; i++)
      if (vec[i] == 0) cnt++;
    cout << cnt;
    return 0;
  }
  int n1 = n / 2;
  int n2 = n - n1;
  for (int i = 0; i < (1 << n1); i++) {
    int sum = 0;
    for (int j = 0; j < n1; j++) {
      if (i & (1 << j)) sum += vec[j];
    }
    left_side[(1000000 / 2) + sum] += 1;
  }
  long long ans = 0;
  for (int i = 0; i < (1 << n2); i++) {
    int sum = 0;
    for (int j = 0; j < n2; j++) {
      if (i & (1 << j)) sum += vec[n1 + j];
    }
    ans += left_side[(1000000 / 2) - sum];
  }
  cout << ans - 1;
  return 0;
}
