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