#include <bits/stdc++.h>
using namespace std;
long long n;
long long want;
long long num[55];
long long ans;
void dfs(long long now, long long cnt, long long sum) {
  if (now == n) {
    if ((float)sum / (float)cnt == want) {
      ans++;
    }
    return;
  }
  dfs(now + 1, cnt, sum);
  dfs(now + 1, cnt + 1, sum + num[now + 1]);
  return;
}
int main() {
  ans = 0;
  scanf("%lld %lld", &n, &want);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &num[i]);
  }
  dfs(0, 0, 0);
  cout << ans << endl;
  return 0;
}
