#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> X(N + 1);
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  long long int dp[N + 10][N + 10][A * N + 10];
  for (long long int i = 0; i < (long long int)N + 1; i++) {
    for (long long int j = 0; j < (long long int)N + 1; j++) {
      for (long long int k = 0; k < (long long int)A * N + 1; k++) {
        dp[i][j][k] = 0;
      }
    }
  }
  dp[0][0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k <= N * A; k++) {
        dp[i + 1][j + 1][k + X[i]] += dp[i][j][k];
        dp[i + 1][j][k] += dp[i][j][k];
      }
    }
  }
  long long int res = 0;
  for (int i = 1; i <= N; i++) {
    res += dp[N][i][A * i];
  }
  cout << res << endl;
}
