#include <bits/stdc++.h>
using namespace std;
long long N, A, cnt, ans, chk[101];
vector<long long> v;
long long dfs(long long x, long long sum, long long div, long long r) {
  if (x == v.size() + 1) return 0;
  if (div > 0 && sum % div == 0 && r == 0) {
    long long r = sum / div;
    if (r == A) {
      ans++;
    }
  }
  if (div > 0 && sum / div < A) return 0;
  dfs(x + 1, v[x] + sum, div + 1, 0);
  dfs(x + 1, sum, div, 1);
}
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; i++) {
    long long x;
    cin >> x;
    if (A == x) {
      if (!chk[x]) ans = 1, chk[x] = 1;
      cnt++;
    } else
      v.push_back(x);
  }
  if (v.size()) {
    sort(v.begin(), v.end(), greater<int>());
    if (v[v.size() - 1] <= A) dfs(0, 0, 0, 0);
  }
  for (int i = 0; i < cnt; i++) ans *= 2;
  if (chk[A])
    cout << ans - 1;
  else if (ans)
    cout << ans;
  else
    cout << 0;
}
