#include <iostream>

using namespace std;

const int N = 55;

int x[N];
long long f[N][N * N];

int main() {
  int n, A;
  cin >> n >> A;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
  }
  f[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = i - 1; j >= 0; --j) {
      for (int k = N * N - 1; k >= 0; --k) {
        if (k >= x[i]) {
          f[j + 1][k] += f[j][k - x[i]];
        }
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += f[i][A * i];
  }
  cout << ans << endl;
  return 0;
}