#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a, ans = 0;
  cin >> n >> a;
  vector<int> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  for (int i = (1); i < ((1LL << (n))); ++i) {
    int sum = 0, cnt = 0;
    for (int j = 0; j < (n); ++j) {
      if ((i >> j) & 1) {
        sum += v[j];
        cnt++;
      }
    }
    if (sum == a * cnt) ans++;
  }
  cout << ans << endl;
  return 0;
}
