#include <bits/stdc++.h>
using namespace std;
int n, avg;
int a[51];
long long int cnt = 0;
void dfs(int index, int sum, int used) {
  if (index >= n) {
    if (sum == 0 && used > 0) cnt++;
    return;
  } else {
    dfs(index + 1, sum + a[index], used + 1);
    dfs(index + 1, sum, used);
  }
}
int main() {
  cin >> n;
  cin >> avg;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] -= avg;
  }
  dfs(0, 0, 0);
  cout << cnt << "\n";
  return 0;
}
