#include <bits/stdc++.h>
using namespace std;
const long long int N = 500000;
bool prime[N];
void sieve() {
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p < 100000000; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i < 100000; i += p) prime[i] = false;
    }
  }
}
long long int nxt() {
  long long int x;
  cin >> x;
  return x;
}
long long int arr[100][100][2000];
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long int n = nxt();
  long long int k = nxt();
  long long int ar[n];
  generate(ar, ar + n, nxt);
  arr[0][0][0] = 1;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      for (long long int m = 0; m < 1000; m++) {
        if (arr[i][j][m])
          arr[i + 1][j][m] += arr[i][j][m],
              arr[i + 1][j + 1][m + ar[i]] += arr[i][j][m];
      }
    }
  }
  long long int cnt = 0;
  for (long long int i = 1; i <= n; i++) cnt += arr[n][i][i * k];
  cout << cnt;
  return 0;
}
