#include <bits/stdc++.h>
using ll = long long;
constexpr ll MOD = 1000000007;
using std::cin;
using std::cout;
using std::endl;
using std::list;
using std::map;
using std::multimap;
using std::multiset;
using std::pair;
using std::set;
using std::sort;
using std::stack;
using std::string;
using std::unordered_map;
using std::unordered_multimap;
using std::unordered_set;
using std::vector;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll pow(ll a, ll b) {
  ll ans = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      ans *= a;
      ans %= MOD;
    }
    b /= 2;
    a *= a;
    a %= MOD;
  }
  return ans;
}
ll comb(ll a, ll b) {
  if (a - b < b) {
    return comb(a, a - b);
  }
  ll c = 1;
  for (ll i = (ll)(a - b + 1); i < (ll)(a + 1); ++i) {
    c *= i;
    c %= MOD;
  }
  ll k = 1;
  for (ll i = (ll)(2); i < (ll)(b + 1); ++i) {
    k *= i;
    k %= MOD;
  }
  c *= pow(k, MOD - 2);
  return c % MOD;
}
multiset<ll> prime_decomposition(ll n) {
  ll i = 2;
  multiset<ll> table{};
  while (i * i <= n) {
    while (n % i == 0) {
      n /= i;
      table.emplace(i);
    }
    ++i;
  }
  if (n > 1) {
    table.emplace(n);
    return table;
  }
  return table;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> v(n);
  for (ll i = (ll)(0); i < (ll)(n); ++i) {
    cin >> v[i];
  }
  vector<vector<vector<ll>>> dp(
      n + 1, vector<vector<ll>>(50 * 50 + 1, vector<long long>(50 + 1)));
  for (ll i = (ll)(1); i < (ll)(n + 1); ++i) {
    for (ll j = (ll)(0); j < (ll)(50 * 50 + 1); ++j) {
      for (ll k = (ll)(1); k < (ll)(50 + 1); ++k) {
        if (j - v[i - 1] > 0) {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - v[i - 1]][k - 1];
        } else {
          dp[i][j][k] = dp[i - 1][j][k];
        }
      }
    }
    dp[i][v[i - 1]][1] = dp[i][v[i - 1]][1] + 1;
  }
  ll c = 0;
  for (ll j = (ll)(0); j < (ll)(50 * 50 + 1); ++j) {
    for (ll k = (ll)(1); k < (ll)(50 + 1); ++k) {
      if (abs((double)j / (double)k - m) < 1e-7) {
        c += dp[n][j][k];
      }
    }
  }
  cout << c << endl;
}
