#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, ch = getchar(), f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int n, A, xi[55];
long long cnt[55][55][2505];
int main() {
  n = read(), A = read();
  for (int i = 1; i <= n; ++i) xi[i] = read();
  cnt[0][0][0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j <= i - 1; ++j)
      for (int k = 0; k <= (i - 1) * 50; ++k) {
        cnt[i][j][k] += cnt[i - 1][j][k];
        cnt[i][j + 1][k + xi[i]] += cnt[i - 1][j][k];
      }
  long long ans = 0;
  for (int i = 1; i * A <= 2500; ++i) ans += cnt[n][i][i * A];
  cout << ans << endl;
  return 0;
}
