#include <bits/stdc++.h>
long long n, a, x, C = 2555, d[55][5555];
int main() {
  int i, j, z;
  scanf("%d%d", &n, &a);
  d[0][C] = 1;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    x -= a;
    for (j = -i * 50; j <= i * 50; j++) {
      d[i][j + C] = d[i - 1][j + C] + d[i - 1][j - x + C];
    }
  }
  printf("%lld", d[n][C] - 1);
}
