#include <bits/stdc++.h>
using namespace std;
static const int MAX_N = 50;
static const int MAX_X = 50;
int N, A;
int x[MAX_N];
long long int memo[MAX_N][MAX_N][MAX_N * MAX_X];
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  memo[0][0][0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k <= N * MAX_X; k++) {
        if (j == 0 || k < x[i - 1]) {
          memo[i][j][k] = memo[i - 1][j][k];
        } else {
          memo[i][j][k] = memo[i - 1][j][k] + memo[i - 1][j - 1][k - x[i - 1]];
        }
      }
    }
  }
  long long int ans = 0;
  for (int i = 1; i <= N; i++) {
    ans += memo[N][i][i * A];
  }
  cout << ans << endl;
  return 0;
}
