#include <cstdio>
#include <cstring>
#define N 110
#define mo 998244353

using namespace std;

int f[N][5010];
int n, w[N];
int sum;
int jc[N];
int ans;

int main(){
//	freopen("funny.in", "r", stdin);
	scanf("%d", &n);
	for (int i=1; i<=n; i++) scanf("%d", &w[i]), sum+=w[i];
	jc[0]=1;
	for (int i=1; i<=n; i++) jc[i]=1ll*jc[i-1]*i%mo;
	if (sum%2==1){
		printf("%d\n", 0);
		return 0;
	}
	int sx=sum/2;
	f[0][0]=1;
	for (int i=1; i<=n; i++){
		for (int j=n; j; j--){
			for (int k=w[i]; k<=sx; k++){
				(f[j][k]+=f[j-1][k-w[i]])%=mo;
			}
		}
	}
	for (int i=1; i<=n; i++){
		(ans+=1ll*jc[i]*jc[n-i]%mo*f[i][sx]%mo)%=mo;
	}
	printf("%d\n", ans);
	
	return 0;
}
#include<map>
#include<set>
#include<list>
#include<ctime>
#include<cmath>
#include<deque>
#include<queue>
#include<stack>
#include<string>
#include<vector>
#include<bitset>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<iostream>
#include<algorithm>
#define rep(i,s,t) for(register int i=s;i<=t;++i)
#define _rep(i,s,t) for(register int i=s;i>=t;--i)
#define Rep(i,s,t) for(register int i=s;i<t;++i)
#define go(x) for(register int e=las[x];e;e=nxt[e])
#define re register
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define is insert
#define es erase
#define pii pair<int,int>
#define ms(f,x) memset(f,x,sizeof f)
#define mc(f,x) memcpy(f,x,sizeof f)
#define open(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
#define gi(x) read(x)
#define gii(x,y) read(x),read(y)
#define giii(x,y,z) read(x),read(y),read(z)
namespace IO{
    #define gc getchar()
    #define pc(x) putchar(x)
    template<typename T>inline void read(T &x){
        x=0;int f=1;char ch=gc;while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=gc;}
        while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=gc;x*=f;return;
    }
    template<typename T>inline void write(T x=0){
        T wr[51];wr[0]=0;if(x<0)pc('-'),x=-x;if(!x)pc(48);
        while(x)wr[++wr[0]]=x%10,x/=10;while(wr[0])pc(48+wr[wr[0]--]);
		putchar('\n');return;
    }
}
using IO::read;
using IO::write;
typedef long long ll;
typedef double db;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
const int N=111,mod=998244353;
int f[N][N*N];
int n,x,sum,fac[N];
void inc(int &x,int y){
	x+=y;
	if(x>=mod)
		x-=mod;
}
int main(){
	gi(n);
	f[0][0]=1;
	fac[0]=1;
	rep(i,1,n)
		fac[i]=1ll*fac[i-1]*i%mod;
	rep(i,1,n){
		gi(x);
		sum+=x;
		_rep(k,i,1)
			_rep(j,sum,x)
				inc(f[k][j],f[k-1][j-x]);
	}
	if(sum&1){
		puts("0");
	}
	else{
		int ans=0;
		rep(i,0,n)
			ans=(ans+1ll*f[i][sum/2]*fac[i]%mod*fac[n-i])%mod;
		cout<<ans<<endl;
	}
	return 0;
} 