#include<iostream>
#include<cstdio>
#include<cstring>
#define re register
#define X first
#define Y second
#define mp std::make_pair
#define pb push_back
#define ohh(hhh...) fprintf(stderr,hhh)
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int,int> pii;
template<class T1> inline bool cmax(T1 &x,T1 y) {return x<y?(x=y,1):0;}
template<class T1> inline bool cmin(T1 &x,T1 y) {return x>y?(x=y,1):0;}
template<class T1> inline T1 dmax(T1 x,T1 y) {return x>y?x:y;}
template<class T1> inline T1 dmin(T1 x,T1 y) {return x<y?x:y;}
const int MAXN=110,mod=998244353;
int n,a[MAXN],fac[MAXN],f[MAXN][MAXN][MAXN*MAXN/2],ans;
int read()
{
	int x=0,w=0;
	char ch=0;
	while(ch<'0'||ch>'9') w|=ch=='-',ch=getchar();
	while('0'<=ch&&ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return w?-x:x;
}
int main()
{
	re int sm=0;
	n=read();
	for(re int i=1;i<=n;i++) a[i]=read(),sm+=a[i];
	if(sm%2==1) {printf("0\n");return 0;}
	re int up=sm/2;
	fac[0]=1;
	for(re int i=1;i<=n;i++) fac[i]=1ll*fac[i-1]*i%mod;
	f[0][0][0]=1;
	for(re int i=1;i<=n;i++)
	{
		for(re int j=0;j<=i;j++)
			for(re int k=0;k<=up;k++) f[i][j][k]=f[i-1][j][k];
		for(re int j=1;j<=i;j++)
			for(re int k=a[i];k<=up;k++) f[i][j][k]=(f[i][j][k]+f[i-1][j-1][k-a[i]])%mod;
	}
	for(re int i=1;i<=n;i++) ans=(ans+1ll*f[n][i][up]*fac[i]%mod*fac[n-i])%mod;
	printf("%d\n",ans);
	return 0;
}
#include <iostream>
#include <vector>
#include <tuple>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#define ll long long
#define rep(i,n) for(int i = 0;i < (int)n;i ++)
#define mod % 998244353
using namespace std;


int main(void){
  ll n;
  cin >> n;
  ll A[n+1];
  A[0] = 1;
  rep(i,n){
    A[i+1] = (A[i]*(i+1))mod;
  }
  vector<ll> w(n);
  ll S = 3;
  rep(i,n){
    cin >> w[i];
    S += w[i];
  }
  sort(w.begin(),w.end());
  ll Q = S;
  vector<vector<vector<ll>>> P(n+1,vector<vector<ll>>(Q,vector<ll>(n+1,0)));
  P[0][Q/2][0] = 1;
  rep(i,n){
    rep(j,Q){
      
      rep(k,n+1){
        P[i][j][k] = P[i][j][k] mod;
        if(P[i][j][k] > 0){
          if(j+w[i]<Q)P[i+1][j+w[i]][k+1] = (P[i+1][j+w[i]][k+1]+P[i][j][k]) mod;
          if(j-w[i]>=0)P[i+1][j-w[i]][k] = (P[i+1][j-w[i]][k]+P[i][j][k]) mod;
        }
      }
    }
  }
  vector<ll> ans = P[n][Q/2];
  ll sum = 0;
  rep(i,n){
    ll M = (A[i]*A[n-i]) mod;
    sum = (sum+ans[i]*M) mod;
  }
  cout << sum << endl;
  return 0;
}