#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> X(N + 1, 0);
  int S = 0;
  for (int i = 1; i <= N; i++) {
    int x;
    cin >> x;
    X[i] = x;
    S += x;
  }
  vector<vector<vector<long long>>> Z(
      N + 1, vector<vector<long long>>(N + 1, vector<long long>(S + 1, 0)));
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= i; j++) {
      for (int k = j; k <= S; k++) {
        Z[i][j][k] = Z[i - 1][j][k];
        if (j == 1 && k == X[i]) {
          Z[i][j][k]++;
          continue;
        }
        if (k - X[i] >= 0) Z[i][j][k] += Z[i - 1][j - 1][k - X[i]];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= N; i++) {
    ans += Z[N][i][A * i];
  }
  cout << ans << endl;
}
