#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007ll;
const long long inf = 1000000000000000ll;
const long long MAX_N = 50, MAX_A = 50;
long long N, A, x[MAX_N], dp[MAX_N][MAX_N][MAX_A * MAX_N];
int main() {
  cin >> N >> A;
  for (long long i = 1; i <= N; i++) {
    cin >> x[i];
  }
  dp[0][0][0] = 1;
  for (long long i = 0; i <= N; i++) {
    for (long long j = 0; j <= N; j++) {
      for (long long k = 0; k <= MAX_A * MAX_N; k++) {
        if (i - 1 >= 0 && j - 1 >= 0 && k - x[i] >= 0) {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
        } else if (i - 1 >= 0 && k - x[i] < 0) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else if (i == 0 && j == 0 && k == 0) {
          dp[i][j][k] = 1;
        } else {
          dp[i][j][k] = 0;
        }
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= N; i++) {
    ans += dp[N][i][i * A];
  }
  cout << ans << endl;
  return 0;
}
