#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const int MOD = 1e9 + 7;
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  int N, A;
  cin >> N >> A;
  int x[N];
  for (int i = 0; i < N; i++) cin >> x[i];
  if (N > 16) return 0;
  int ans = 0;
  for (int i = 0; i < (1 << N); i++) {
    int sum = 0, cnt = 0;
    for (int j = 0; j < N; j++) {
      if ((i >> j) & 1) {
        sum += x[j];
        cnt++;
      }
    }
    if (cnt > 0 && sum % cnt == 0 && sum / cnt == A) ans++;
  }
  cout << ans << endl;
  return 0;
}
