#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
long long int dx[4] = {1, 0, -1, 0};
long long int dy[4] = {0, 1, 0, -1};
long long int n, a;
vector<long long int> x;
void input() {
  cin >> n >> a;
  x.resize(n);
  for (long long int i = 0; i < n; i++) {
    long long int b;
    cin >> b;
    x[i] = b - a;
  }
}
long long int next_combination(long long int sub) {
  long long int x = sub & -sub, y = sub + x;
  return (((sub & ~y) / x) >> 1) | y;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  input();
  long long int ans = 0;
  for (long long int k = 1; k <= n; ++k) {
    for (long long int bit = (1 << k) - 1; bit < (1 << n);
         bit = next_combination(bit)) {
      long long int sum = 0;
      for (long long int i = 0; i < n; ++i) {
        if (bit & (1 << i)) sum += x[i];
      }
      if (sum == 0) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
