#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, a;
  cin >> n >> a;
  int x[50] = {0};
  for (int i = 0; i < n; i++) cin >> x[i];
  vector<vector<vector<int>>> dp(
      51, vector<vector<int>>(50 * 50 + 1, vector<int>(51)));
  dp[0][0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2501; j++) {
      for (int k = 0; k <= 49; k++) {
        if (j - x[i] >= 0 && k - 1 >= 0) {
          dp[i + 1][j][k] = dp[i][j - x[i]][k - 1] + dp[i][j][k];
        } else {
          dp[i + 1][j][k] += dp[i][j][k];
        }
      }
    }
  }
  long long int res = 0;
  for (int i = 1; i <= 50; i++) {
    res += dp[n][i * a][i];
  }
  cout << res << endl;
}
