#include <bits/stdc++.h>
int N;
int A;
int x[50];
long long dp[51][51][2501];
int main() {
  scanf("%d%d", &N, &A);
  for (int i = 0; i < N; i++) scanf("%d", &x[i]);
  memset(dp, 0, sizeof dp);
  for (int i = 0; i <= N; i++) dp[i][0][0] = 1;
  for (int n = 1; n <= N; n++)
    for (int k = 1; k <= n; k++)
      for (int s = 1; s <= k * A; s++) {
        dp[n][k][s] = dp[n - 1][k][s];
        if (s >= x[n - 1]) dp[n][k][s] += dp[n - 1][k - 1][s - x[n - 1]];
      }
  long long r = 0;
  for (int k = 1; k <= N; k++) r += dp[N][k][k * A];
  printf("%lld\n", r);
  return 0;
}
