#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int x[n];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    sum += x[i];
  }
  long long dp[n + 1][sum + 1][n + 1];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i <= n; i++) {
    dp[i][0][0] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= sum; j++) {
      for (int k = 1; k <= n; k++) {
        if (j < x[i])
          dp[i + 1][j][k] = dp[i][j][k];
        else {
          dp[i + 1][j][k] = dp[i][j][k] + dp[i][j - x[i]][k - 1];
        }
      }
    }
  }
  long long ans = 0;
  for (int i = 1; a * i <= sum; i++) {
    ans += dp[n][a * i][i];
  }
  cout << ans << endl;
  return 0;
}
