#include <bits/stdc++.h>
using namespace std;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long kai(long long x, long long y) {
  long long res = 1;
  for (long long i = x - y + 1; i <= x; i++) {
    res *= i;
    res %= 1000000007;
  }
  return res;
}
long long mod_pow(long long x, long long y, long long m) {
  long long res = 1;
  while (y) {
    if (y & 1) {
      res = res * x % m;
    }
    x = x * x % m;
    y >>= 1;
  }
  return res;
}
long long comb(long long x, long long y) {
  if (y > x) return 0;
  return kai(x, y) * mod_pow(kai(y, y), 1000000007 - 2, 1000000007) %
         1000000007;
}
struct edge {
  long long to, cost;
};
long long n, x;
long long a[55];
long long dp[55][55][2530];
signed main() {
  cin >> n >> x;
  for (long long i = 0; i < n; i++) cin >> a[i];
  dp[0][0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      for (long long k = 0; k <= 2525; k++) {
        if (i < j) continue;
        if (k < a[i])
          dp[i][j][k] = dp[i - 1][j][k];
        else
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - a[i - 1]];
      }
    }
  }
  long long ans = 0;
  for (long long j = 1; j <= n; j++) {
    for (long long k = 0; k <= 2525; k++) {
      if (k == x * j) {
        ans += dp[n][j][k];
      }
    }
  }
  cout << ans << endl;
  getchar();
  getchar();
  return 0;
}
