#include <bits/stdc++.h>
int main(void) {
  int n, a;
  std::cin >> n >> a;
  int dp[52][52][52 * 52] = {};
  int array[52] = {};
  for (int i = 1; i <= n; i++) {
    int x;
    std::cin >> x;
    array[i] = x;
  }
  for (int i = 0; i <= n; i++) {
    for (int k = 0; k <= i; k++) {
      for (int N = 0; N <= i * 52; N++) {
        if (i == 0 && k == 0 && N == 0)
          dp[i][k][N] = 1;
        else if (i != 0 && N < array[i])
          dp[i][k][N] = dp[i - 1][k][N];
        else if (i != 0 && k != 0 && N >= array[i])
          dp[i][k][N] = dp[i - 1][k][N] + dp[i - 1][k - 1][N - array[i]];
        else
          dp[i][k][N] = 0;
      }
    }
  }
  long long int res = 0;
  for (int k = 1; k <= n; k++) {
    res += dp[n][k][k * a];
  }
  std::cout << res << std::endl;
  return 0;
}
