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