#include <bits/stdc++.h>
using namespace std;
int X[50];
long long table[51][51][2501];
int N, A;
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; ++i) {
    cin >> X[i];
  }
  long long pat = 0;
  table[0][0][0] = 1;
  for (int i = 0; i <= N; ++i) {
    for (int c = 0; c <= N; ++c) {
      for (int s = 0; s <= c * A; ++s) {
        if (i == 0 && c == 0 && s == 0) {
          table[i][c][s] = 1;
        } else if (i > 0 && c >= 1 && s >= X[i - 1]) {
          table[i][c][s] =
              table[i - 1][c - 1][s - X[i - 1]] + table[i - 1][c][s];
        } else if (i > 0 && s < X[i - 1]) {
          table[i][c][s] = table[i - 1][c][s];
        } else {
          table[i][c][s] = 0;
        }
      }
    }
  }
  for (int c = 1; c <= N; ++c) {
    pat += table[N][c][c * A];
  }
  cout << pat << endl;
  return 0;
}
