#include<iostream>
#include<numeric>
using namespace std;
const int VAL = 105;
const int BUF = 5005;
const int MOD = 998244353;


int fact[VAL];

void makeTable() {
    fact[0] = 1;
    for (int i = 1; i < VAL; ++i) {
        fact[i] = 1LL * i * fact[i - 1] % MOD;
    }
}


int nVal;
int val[VAL];

void read() {
    cin >> nVal;
    for (int i = 0; i < nVal; ++i) {
        cin >> val[i];
    }
}


void work() {
    int total = accumulate(val, val + nVal, 0);
    if (total % 2 != 0) {
        cout << 0 << endl;
        return;
    }
    
    int dp[VAL][BUF] = {};
    dp[0][0] = 1;
    
    for (int loop = 0; loop < nVal; ++loop) {
        for (int nPick = loop; nPick >= 0; --nPick) {
            for (int sum = 0; sum + val[loop] <= total / 2; ++sum) {
                if (!dp[nPick][sum]) continue;
                dp[nPick + 1][sum + val[loop]] = (dp[nPick + 1][sum + val[loop]] + dp[nPick][sum]) % MOD;
            }
        }
    }

    int ans = 0;
    for (int nPick = 0; nPick <= nVal; ++nPick) {
        ans = (ans + 1LL * dp[nPick][total / 2] * fact[nPick] % MOD * fact[nVal - nPick]) % MOD;
    }
    cout << ans << endl;
}


int main() {
    makeTable();
    read();
    work();
    return 0;
}

//#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define re register int
#define ll long long
#define I inline int
#define V inline void
#define LL inline ll
#define FOR(i,a,b) for(re i=(a),i##i=(b);i<=i##i;++i)
#define ROF(i,a,b) for(re i=(a),i##i=(b);i>=i##i;--i)
#define gc (_ft==_fs&&(_ft=(_fs=buf)+fread(buf,1,1<<20,stdin),_ft==_fs))?0:*_fs++
//#define gc getchar()
using namespace std;
const int N=2e4+10,M=110,mo=998244353;
char buf[1<<20],*_fs,*_ft;
LL read(){
	ll w=0,p=0; char ch=gc;
	while(!isdigit(ch)) w=ch=='-',ch=gc;
	while(isdigit(ch))  p=p*10+ch-'0',ch=gc;
	return w?-p:p;
}
int n,a[M],tot,fl;
ll ans,dp[M][N],f[M],fc[M],fv[M];
LL Pow(ll x,ll y){ ll as=1; for(;y;y>>=1,x=x*x%mo) if(y&1) as=as*x%mo; return as;}
LL ck(ll x){ return x-=mo,x+=x>>63&mo; }
V ipt(){ n=read();  FOR(i,1,n) a[i]=read(),tot+=a[i];}
V ycl(){
	fc[0]=1;
	FOR(i,1,n) fc[i]=fc[i-1]*i%mo;
	return ;
}
V sol(){
	if(tot&1) return ;
	dp[0][0]=1,tot>>=1;
	FOR(i,1,n) ROF(j,i-1,0) ROF(k,tot,0){
		dp[j+1][k+a[i]]=ck(dp[j+1][k+a[i]]+dp[j][k]);
	}
	FOR(i,0,n) f[i]=dp[i][tot];
	FOR(i,0,n){
		if(2*i==n) ans=(ans+f[i]*fc[i]%mo*fc[i]%mo)%mo;
		else ans=(ans+f[i]%mo*fc[i]%mo*fc[n-i]%mo)%mo;
	}
	return ;
} 
V opt(){ cout<<ans; }
int main(){
	ipt();
	ycl();
	sol();
	opt();
	return 0;
}