#include <bits/stdc++.h>
using namespace std;
constexpr int kMaxN = 51;
constexpr int kMaxX = 51;
int x[kMaxN] = {0};
int dp[kMaxN][kMaxN][kMaxN * kMaxX] = {{{0}}};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, A;
  cin >> N >> A;
  int X = 0;
  for (int i = 1; i <= N; ++i) {
    cin >> x[i];
    X = max(X, x[i]);
  }
  for (int j = 0; j <= N; ++j) {
    for (int k = 0; k <= N; ++k) {
      for (int s = 0; s <= N * X; ++s) {
        if (j == 0 && k == 0 && s == 0) {
          dp[j][k][s] = 1;
        } else if (1 <= j && s < x[j]) {
          dp[j][k][s] = dp[j - 1][k][s];
        } else if (1 <= j && 1 <= k && x[j] <= s) {
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
        } else {
          dp[j][k][s] = 0;
        }
      }
    }
  }
  long long ans = 0;
  for (int k = 1; k <= N; ++k) ans += dp[N][k][k * A];
  cout << ans << endl;
  return 0;
}
