#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
  ll x[50][50][2501] = {{{}}};
  ll n;
  cin >> n;
  cin >> a;
  ll y[50] = {};
  for (int i = 1; i <= n; i++) {
    cin >> y[i];
  }
  x[0][0][0] = 1;
  for (int i = 0; i <= n; i++) {
    for (int k = 0; k <= i; k++) {
      for (int l = 0; l <= 50 * k; l++) {
        if (l - y[i] >= 0 && i - 1 >= 0 && k - 1 >= 0) {
          x[i][k][l] = x[i - 1][k][l] + x[i - 1][k - 1][l - y[i]];
        } else if (i - 1 >= 0) {
          x[i][k][l] = x[i - 1][k][l];
        }
      }
    }
  }
  for (int k = 1; k <= n; k++) {
    c += x[n][k][k * a];
  }
  cout << c << endl;
  return 0;
}
