#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000000000000;
const double PI = acos(-1);
int n, a;
int dp[100][100][100];
int x[100];
int main() {
  cin >> n >> a;
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int j = 0; j <= n; j++) {
    for (int k = 0; k <= n; k++) {
      for (int s = 0; s <= n * 50; s++) {
        if (j >= 1 && s < x[j]) dp[j][k][s] = dp[j - 1][k][s];
        if (j >= 1 && k >= 1 && s >= x[j])
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
      }
    }
  }
  LL ans = 0;
  for (int k = 1; k <= n; k++) {
    ans += dp[n][k][k * a];
  }
  cout << ans << endl;
}
