//khodaya khodet komak kon
# include <bits/stdc++.h>

using namespace std;

typedef long long                                        ll;
typedef long double                                      ld;
typedef pair <int, int>                                  pii;
typedef pair <pii, int>                                  ppi;
typedef pair <int, pii>                                  pip;
typedef pair <pii, pii>                                  ppp;
typedef pair <ll, ll>                                    pll;

# define A                                               first
# define B                                               second
# define endl                                            '\n'
# define sep                                             ' '
# define all(x)                                          x.begin(), x.end()
# define kill(x)                                         return cout << x << endl, 0
# define SZ(x)                                           int(x.size())
# define lc                                              id << 1
# define rc                                              id << 1 | 1
# define InTheNameOfGod                                  ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);

ll power(ll a, ll b, ll md) {return (!b ? 1 : (b & 1 ? a * power(a * a % md, b / 2, md) % md : power(a * a % md, b / 2, md) % md));}

const int xn = 1e2 + 10;
const int xm = - 20 + 10;
const int sq = 320;
const int inf = 1e9 + 10;
const ll INF = 1e18 + 10;
const ld eps = 1e-15;
const int mod = 998244353;
const int base = 257;

int n, a[xn], dp[xn][xn * xn], sum, fact[xn], ans;

int main(){
	InTheNameOfGod;

	fact[0] = 1;
	for (int i = 1; i < xn; ++ i)
		fact[i] = 1ll * fact[i - 1] * i % mod;
	cin >> n;
	for (int i = 1; i <= n; ++ i)
		cin >> a[i], sum += a[i];
	if (sum % 2)
		kill(0);
	dp[0][0] = 1;
	for (int i = 1; i <= n; ++ i)
		for (int j = i; j >= 1; -- j)
			for (int k = sum / 2; k >= a[i]; -- k)
				dp[j][k] = (dp[j][k] + dp[j - 1][k - a[i]]) % mod;
	for (int i = 1; i <= n; ++ i)
		ans = (ans + 1ll * dp[i][sum / 2] * fact[i] % mod * fact[n - i] % mod) % mod;
	cout << ans << endl;

	return 0;
}

#include<bits/stdc++.h>
template <typename _Tp>void read(_Tp &x){
	char ch(getchar());bool f(false);while(!isdigit(ch))f|=ch==45,ch=getchar();
	x=ch&15,ch=getchar();while(isdigit(ch))x=x*10+(ch&15),ch=getchar();
	if(f)x=-x;
}
template <typename _Tp,typename... Args>void read(_Tp &t,Args &...args){read(t);read(args...);}
const int N=105,mod=998244353;
template<typename _Tp1,typename _Tp2>inline void add(_Tp1 &a,_Tp2 b){(a+=b)>=mod&&(a-=mod);}
template<typename _Tp1,typename _Tp2>inline void sub(_Tp1 &a,_Tp2 b){(a-=b)<0&&(a+=mod);}
int f[N][20005],g[N][20005];
long long fac[N];
int main(){
	fac[0]=fac[1]=1;for(int i=2;i<N;++i)fac[i]=fac[i-1]*i%mod;
	int n;read(n);
	f[0][10000]=1;int s=0;
	for(int i=1,x;i<=n;++i){
		read(x),s=std::min(10000,x+s);
		memset(g,0,sizeof(g));
		for(int j=0;j<i;++j){
			for(int k=10000-s;k<=10000+s;++k){
				if(k-x>=0)add(g[j+1][k-x],f[j][k]);
				if(k+x<=20000)add(g[j][k+x],f[j][k]);
			}
		}
		memcpy(f,g,sizeof(f));
	}
	int ans=0;
	for(int i=0;i<=n;++i)add(ans,1LL*f[i][10000]*fac[i]%mod*fac[n-i]%mod);
	printf("%d\n",ans);
	return 0;
}