#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 1;
const long long MOD = 1e9 + 7;
const long double PI = 3.14159265358979323846264338;
long long fast_ex(long long a, long long n, long long m) {
  if (n == 0) return 1;
  if (n == 1) return a;
  long long x = 1;
  x *= fast_ex(a, n / 2, m);
  x %= m;
  x *= x;
  x %= m;
  if (n % 2) x *= a;
  x %= m;
  return x;
}
long long n, k;
long long a[51], dp[51][51][2501];
void solve() {
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  dp[0][0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    dp[i][0][0] = 1;
    for (long long j = 1; j <= i; j++) {
      for (long long k = 0; k < 2501; k++) {
        dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - a[i]];
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans += (dp[n][i][i * k]);
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
