#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
const long double EPS = 1e-9;
const long double PI = 3.141592653589793;
const long long MOD = 1e9 + 7;
const int SQRT = 300;
const int LG = 21;
const int FOURIER = (1 << LG);
long long dp[51][51][251];
int x[100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  int a;
  cin >> n >> a;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int el = 0; el <= n; ++el)
      for (int sum = 0; sum <= 250; ++sum) {
        dp[i][el][sum] = dp[i - 1][el][sum];
        if (sum >= x[i] && el) dp[i][el][sum] += dp[i - 1][el - 1][sum - x[i]];
      }
  }
  long long ans = 0;
  for (int col = 1; col <= n; ++col) {
    int need = a * col;
    ans += dp[n][col][need];
  }
  cout << ans;
}
