#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000000ll;
const long long MOD = 1000000007ll;
const double EPS = 1e-8;
int dp[51][51][2501];
int main(void) {
  int n;
  int a;
  cin >> n >> a;
  vector<int> x;
  x.push_back(0);
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    x.push_back(t);
  }
  for (int i = 0; i <= n; i++) {
    dp[i][0][0] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 0; k <= 2500; k++) {
        if (k - x[i] >= 0) {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
        } else {
          dp[i][j][k] = dp[i - 1][j][k];
        }
      }
    }
  }
  long long ans = 0;
  for (int j = 1; j <= n; j++) {
    for (int k = 0; k <= 2500; k++) {
      if ((k % j == 0) && (k / j == a)) {
        ans += dp[n][j][k];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
