#include <bits/stdc++.h>
#pragma GCC optimize( \
    "Ofast,no-stack-protector,unroll-loops,no-stack-protector,fast-math")
using namespace std;
const int N = 2e5 + 5, M = 2 * N + 5;
int n, a[20], ans, tar;
void f(int i, int sum, int cnt) {
  if (i == n) {
    if (!cnt) return;
    long double tmp = 1.0L * sum / cnt;
    ans += (tmp == tar);
    return;
  }
  f(i + 1, sum, cnt);
  f(i + 1, sum + a[i], cnt + 1);
}
int main() {
  scanf("%d %d", &n, &tar);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  f(0, 0, 0);
  printf("%d\n", ans);
}
