#include <bits/stdc++.h>
using namespace std;
int n, a, x[55];
long long dp[55][55][2555];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> a;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  dp[0][0][0] = 1LL;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      for (int k = 0; k <= a * i; ++k) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (j > 0 && k - x[i] >= 0) dp[i][j][k] += dp[i - 1][j - 1][k - x[i]];
      }
    }
  }
  long long res = 0LL;
  for (int i = 1; i <= n; ++i) res += dp[n][i][a * i];
  cout << res;
}
