#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int INF = 1 << 20;
using namespace std;
int n, a;
int x[55];
long long ans = 0;
int dfs(int pos, int sum, int cnt) {
  if (pos == n - 1) {
    return ans;
  }
  if (sum == a * cnt) ans++;
  dfs(pos + 1, sum + x[pos], cnt + 1);
  dfs(pos + 1, sum, cnt);
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  cout << dfs(0, 0, 0) << endl;
}
