#include <bits/stdc++.h>
using namespace std;
int n, a, i, j, k, cnta[55][2505], cntb[55][2505], val[55];
void solve(int id, int lim, int pick, int now, int (&A)[55][2505]) {
  if (id == lim) {
    A[pick][now]++;
    return;
  }
  solve(id + 1, lim, pick + 1, now + val[id], A);
  solve(id + 1, lim, pick, now, A);
}
int main() {
  scanf("%d%d", &n, &a);
  for (i = 0; i < n; i++) scanf("%d", &val[i]);
  int mid = n / 2;
  solve(0, mid, 0, 0, cnta);
  solve(mid, n, 0, 0, cntb);
  long long ans = 0;
  for (i = 0; i <= mid; i++) {
    for (j = 0; j <= 2500; j++) {
      for (k = i; k <= n; k++) {
        long long target = k * a - j;
        if (target < 0) continue;
        if (k == 0) continue;
        ans += cnta[i][j] * cntb[k - i][target];
      }
    }
  }
  printf("%lld\n", ans);
}
