#include <bits/stdc++.h>
long long d[55][5005];
int main() {
  freopen("input.txt", "r", stdin);
  int i, j, n, a, x, z = 0;
  scanf("%d%d", &n, &a);
  d[0][2500] = 1;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    x -= a;
    for (j = 0; j <= 5000; j++) {
      d[i][j] += d[i - 1][j];
      d[i][j + x] += d[i - 1][j];
    }
  }
  printf("%lld", d[n][2500] - 1);
}
