#include <bits/stdc++.h>
using namespace std;
int N, A, x[17];
long long int dp[17][17 * 17][17];
long long int f(int i, int s, int n) {
  if (dp[i][s][n] != -1) return dp[i][s][n];
  if (i == N) {
    if (s == A * n and n != 0)
      return dp[i][s][n] = 1;
    else
      return dp[i][s][n] = 0;
  }
  return dp[i][s][n] = f(i + 1, s + x[i], n + 1) + f(i + 1, s, n);
}
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; i++) cin >> x[i];
  for (int i = 0; i < 17; i++)
    for (int j = 0; j < 17 * 17; j++)
      for (int k = 0; k < 17; k++) dp[i][j][k] = -1LL;
  f(0, 0, 0);
  cout << dp[0][0][0] << endl;
  return 0;
}
