#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const int MAXN = 100000;
const int MAXE = 100000;
const int MAXV = 10000;
const long long INF = 2e9;
int main() {
  int n, a;
  cin >> n >> a;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  int dp[n + 1][n + 1][2501];
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k <= 2500; k++) {
        dp[i][j][k] = 0;
      }
    }
  }
  dp[0][0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i + 1; j++) {
      for (int k = 0; k <= 2500; k++) {
        dp[i + 1][j][k] += dp[i][j][k];
        if (k >= x[i] && j > 0) dp[i + 1][j][k] += dp[i][j - 1][k - x[i]];
      }
    }
  }
  long long ans = 0;
  for (int j = 1; j <= n; j++) {
    ans += dp[n][j][j * a];
  }
  cout << ans << endl;
  return 0;
}
