#include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do { cout << "\033[32;1m " << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;
template<class T> void mkuni(vector<T>&v)
{
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
}
ll rand_int(ll l, ll r) //[l, r]
{
    static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
    return uniform_int_distribution<ll>(l, r)(gen);
}
template<class T>
void print(T x,int suc=1)
{
    cout<<x;
    if(suc==1) cout<<'\n';
    else cout<<' ';
}
template<class T>
void print(const vector<T>&v,int suc=1)
{
    for(int i=0;i<v.size();i++)
    print(v[i],i==(int)(v.size())-1?suc:2);
}
const int maxn=1e4+7;
const int mod=998244353;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin>>n;
    vi a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    vc<vi> dp(n+1,vi(maxn));
    int sum=0;
    dp[0][0]=1;
    for(int i=1;i<=n;i++)
    {
        sum+=a[i-1];
        for(int j=n-1;j>=0;j--)
        {
            for(int k=a[i-1];k<maxn;k++)
                dp[j+1][k]=(dp[j+1][k]+dp[j][k-a[i-1]])%mod;
        }
    }
    if(sum%2!=0) print(0);
    else{
        ll ans=0;
        for(int i=0;i<=n;i++)
        {
            ll cur=dp[i][sum/2];
            //dbg(i,cur);
            for(int j=1;j<=i;j++) cur=cur*j%mod;
            for(int j=1;j<=n-i;j++) cur=cur*j%mod;
            ans=(ans+cur)%mod;
        }
        print(ans);
    }
}
#include<bits/stdc++.h>
using namespace std;
int n , a[110] , noww , las;
long long dp[2][22000][220] , ans , fac[200];
const int mod = 998244353;
int main()
{
	scanf("%d" , &n); fac[0] = 1;
	for(int i = 1 ; i <= n ; i++ ) scanf("%d" , &a[i]) , fac[i] = fac[i - 1] * i % mod;
	dp[0][10000][100] = 1;
	for(int i = 1 ; i <= n ; i++ )
	{
		las = noww; noww ^= 1; memset(dp[noww] , 0 , sizeof(dp[noww]));
		for(int s = 0 ; s <= 20000 ; s++ )
		{
			for(int x = 0 ; x <= 200 ; x++ )
			{
				if(s + a[i] <= 20000 && x + 1 <= 200) 
					(dp[noww][s + a[i]][x + 1] += dp[las][s][x]) %= mod;
				if(s - a[i] >= 0 && x - 1 >= 0) 
					(dp[noww][s - a[i]][x - 1] += dp[las][s][x]) %= mod;
			}
		}
	}
	for(int i = 0 ; i <= 200 ; i++ ) 
	{
		int a = (n + 100 - i) / 2 , b = (n - 100 + i) / 2;
		(ans += fac[a] * fac[b] % mod * dp[noww][10000][i] % mod) %= mod;
	}
	cout << ans;
	return 0;
}
/*
100
2 8 4 7 5 3 1 2 4 1 2 5 4 3 3 8 1 7 8 2 
2 8 4 7 5 3 1 2 4 1 2 5 4 3 3 8 1 7 8 2 
2 8 4 7 5 3 1 2 4 1 2 5 4 3 3 8 1 7 8 2 
2 8 4 7 5 3 1 2 4 1 2 5 4 3 3 8 1 7 8 2 
2 8 4 7 5 3 1 2 4 1 2 5 4 3 3 8 1 7 8 2 

*/  