#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9000000009;
signed main() {
  long long n, a;
  cin >> n >> a;
  vector<long long> x(n);
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
    x[i] -= a;
  }
  long long ans = 0;
  long long bit = 0;
  for (long long i = 0; i < 1 << n; i++) {
    long long tmp = 0;
    for (long long j = 0; j < n; j++) {
      tmp += x[j] * (bit >> j & 1);
    }
    bit++;
    if (tmp == 0) ans++;
  }
  cout << ans - 1 << endl;
  return 0;
}
