#include <bits/stdc++.h>
 
#define int long long
// #define endl "\n"
#define MOD 1000000007
 
using namespace std;
 
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
    os << "[ ";
    for (auto v : V)
        os << v << " ";
    os << "]";
    return os;
}
template <class T> ostream &operator<<(ostream &os, array<T, 2> A) {
    os << "[ ";
    for (auto a : A) { 
        os << a << " ";
    }
    os << "]";
    return os;
}
template <class T> ostream &operator<<(ostream &os, set<T> S) {
    os << "{ ";
    for (auto s : S)
        os << s << " ";
    return os << "}";
}
template <class T> ostream &operator<<(ostream &os, multiset<T> S) {
    os << "{ ";
    for (auto s : S)
        os << s << " ";
    return os << "}";
}
template <class L, class R> ostream &operator<<(ostream &os, map<L, R> M) {
    os << "{ ";
    for (auto m : M)
        os << "(" << m.first << ":" << m.second << ") ";
    return os << "}";
}
template <class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) {
    return os << "(" << P.first << "," << P.second << ")";
}

void solve() {
    int n;
    cin >> n;
    int a[n];
    pair<int, int> dp[n][2];
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }

    auto f = [&] (long double x) {
        long double res = 0;
        for(int i = 0; i < n; i++) {
            res += x + a[i] - min((long double)a[i], 2 * x);
        }
        res /= n;
        return res;
    };

    long double l = 0, r = 1e9, mid1 = 0, mid2 = 0;
    do {
        mid1 = (2 * l + r) / 3;
        mid2 = (l + 2 * r) / 3;
        if(f(mid1) > f(mid2)) {
            l = mid1;
        }
        else r = mid2;
    } while(abs(r - l) > 0.0000000001);

    cout << fixed;
    cout << setprecision(8) << f((l + r) / 2) << endl;
}

int32_t main() {
    int t = 1;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // cin >> t;
    while(t--) {
        solve();
    }
#ifndef ONLINE_JUDGE
    cout << "\nTime Elapsed : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC << " ms\n";
#endif
    return 0;
}
#include <bits/stdc++.h>
const int N = 105, P = 998244353;
int n, s, w[N], dp[N][N * N], fac[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &w[i]), s += w[i];
  for (int i = fac[0] = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % P;
  if (s & 1) return puts("0"), 0;
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) 
    for (int j = i; j; --j) 
      for (int v = s / 2; v; --v) {
        if (v >= w[i]) dp[j][v] = (dp[j][v] + dp[j - 1][v - w[i]]) % P;
      }
  int ans = 0;
  for (int i = 1; i < n; ++i) ans = (ans + 1ll * dp[i][s / 2] * fac[i] % P * fac[n - i]) % P;
  return printf("%d\n", ans), 0;
}