#include <bits/stdc++.h>
using LL = long long;
int N, A;
std::vector<int> fig;
int dp[51][51][2501];
LL ans;
int main() {
  for (int i = 0; i < 51; i++) dp[i][0][0] = 1;
  std::cin >> N >> A;
  for (int i = 0; i < N; i++) {
    int tmp;
    std::cin >> tmp;
    fig.push_back(tmp);
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      for (int k = 0; k <= N * 50; k++) {
        if (fig[i - 1] > k) {
          dp[i][j][k] = dp[i - 1][j][k];
          continue;
        }
        if (fig[i - 1] <= k) {
          dp[i][j][k] = dp[i - 1][j - 1][k - fig[i - 1]] + dp[i - 1][j][k];
          continue;
        }
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    ans += dp[N][i][i * A];
  }
  std::cout << ans << std::endl;
  return 0;
}
