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