#include <bits/stdc++.h>
using namespace std;
int n, n1, n2, n0, m, m1, m2, a, x1[100], x2[100];
long long dp1[60][3000], dp2[60][3000], ans;
int main() {
  scanf("%d%d", &n, &a);
  for (int i = 1; i <= (n); ++i) {
    int t;
    scanf("%d", &t);
    t -= a;
    if (t > 0) {
      x1[++n1] = t;
      m1 += t;
    } else if (t < 0) {
      x2[++n2] = -t;
      m2 += -t;
    } else
      ++n0;
  }
  m = max(m1, m2);
  dp1[0][0] = 1;
  for (int i = 1; i <= (n1); ++i) {
    for (int j = (0); j <= (m); ++j) {
      dp1[i][j] = dp1[i - 1][j];
      if (j >= x1[i]) dp1[i][j] += dp1[i - 1][j - x1[i]];
    }
  }
  dp2[0][0] = 1;
  for (int i = 1; i <= (n2); ++i) {
    for (int j = (0); j <= (m); ++j) {
      dp2[i][j] = dp2[i - 1][j];
      if (j >= x2[i]) dp2[i][j] += dp2[i - 1][j - x2[i]];
    }
  }
  ans = 0;
  for (int j = (0); j <= (m); ++j) ans += dp1[n1][j] * dp2[n2][j];
  for (int i = 1; i <= (n0); ++i) ans *= 2;
  if (n0) --ans;
  printf("%lld\n", ans);
  return 0;
}
