#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const int INF = 2147483647;
int N, A;
int x[51];
long long dp[51][51][2500];
long long ans;
int main() {
  scanf("%d%d", &N, &A);
  for (int i = 1; i <= N; ++i) {
    scanf("%d", x + i);
  }
  dp[0][0][0] = 1;
  for (int i = 1; i <= N; ++i) {
    dp[i][0][0] = 1;
    for (int j = 1; j <= i; ++j) {
      for (int k = N * A; k >= x[i]; --k) {
        dp[i][j][k] = dp[i - 1][j - 1][k - x[i]] + dp[i - 1][j][k];
      }
      for (int k = x[i] - 1; k > 0; --k) {
        dp[i][j][k] = dp[i - 1][j][k];
      }
    }
  }
  for (int i = 1; i <= N; ++i) {
    ans += dp[N][i][A * i];
  }
  printf("%lld\n", ans);
  return 0;
}
