#include <cstdio>

int const SH = 50 * 100 + 2;

long long dp[2 * SH];

int main() {
  int n, A;
  scanf("%d%d", &n, &A);
  dp[SH] = 1;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    x -= A;
    if (x == 0) {
      for (int j = 0; j < 2 * SH; j++) dp[j] *= 2;
    } else if (x < 0) {
      for (int j = 0; j < 2 * SH; j++) dp[j] += dp[j - x];
    } else {
      for (int j = 2 * SH - 1; j >= 0; j--) {
        dp[j] += dp[j - x];
      }
    }
  }
  printf("%lld\n", dp[SH] - 1);
}