#include<bits/stdc++.h>
using namespace std;
#define ri register int
typedef long long ll;
const int maxn=110,mod=998244353;
inline bool ckmin(int &x,const int &y){return x>y?x=y,1:0;}
inline bool ckmax(int &x,const int &y){return x<y?x=y,1:0;}
struct modint{
	int val;
	inline modint(int val_=0):val(val_){}
	inline modint &operator=(int val_){return val=val_,*this;}
	inline modint &operator+=(const modint &k){return val=val+k.val>=mod?val+k.val-mod:val+k.val,*this;}
	inline modint &operator-=(const modint &k){return val=val-k.val<0?val-k.val+mod:val-k.val,*this;}
    inline modint &operator*=(const modint &k){return val=1ll*val*k.val%mod,*this;}
    inline modint &operator^=(int k){
        modint ret=1,tmp=*this;
        for(;k;k>>=1,tmp*=tmp)if(k&1)ret*=tmp;
        return val=ret.val,*this;
    }
    inline modint &operator/=(modint k){return *this*=(k^=mod-2);}
    inline modint &operator+=(int k){return val=val+k>=mod?val+k-mod:val+k,*this;}
    inline modint &operator-=(int k){return val=val<k?val-k+mod:val-k,*this;}
    inline modint &operator*=(int k){return val=1ll*val*k%mod,*this;}
    inline modint &operator/=(int k){return *this*=((modint(k))^=mod-2);}
    template<class T>friend modint operator+(modint a,T b){return a+=b;}
    template<class T>friend modint operator-(modint a,T b){return a-=b;}
    template<class T>friend modint operator*(modint a,T b){return a*=b;}
    template<class T>friend modint operator/(modint a,T b){return a/=b;}
    friend modint operator^(modint a,int b){return a^=b;}
    friend bool operator==(modint a,int b){return a.val==b;}
    friend bool operator!=(modint a,int b){return a.val!=b;}
    inline bool operator!(){return !val;}
    inline modint operator-(){return val?mod-val:0;}
    inline modint &operator++(int){return *this+=1;}
};
using mi=modint;
mi ans,f[maxn*maxn][maxn],fac[maxn];
int a[maxn],m,n;
int main(){
	scanf("%d",&n);
	fac[0]=1;
	for(ri i=1;i<=n;++i){
		scanf("%d",a+i);
		m+=a[i];
		fac[i]=fac[i-1]*i;
	}
	if(m&1)return puts("0"),0;
	m>>=1;
	f[0][0]=1;
	for(ri i=1;i<=n;++i)
		for(ri j=m;j>=a[i];--j)
			for(ri k=n;k;--k)
				f[j][k]+=f[j-a[i]][k-1];
	for(ri i=1;i<n;++i)ans+=f[m][i]*fac[i]*fac[n-i];
	printf("%d",ans);
	return 0;
}
#include <bits/stdc++.h>
#define f(i,j,k) for(long long i=j;i<k;i++)
#define f2(i,j,k) for(long long i=j;i>=k;i--)
#define ll long long 
using namespace std;
const long long mod=1e9+7;
const ll infl = 1LL << 60;
ll H,W,A,B;
bool used[16][16];
ll dfs(ll x,ll y,ll a){
    ll ans=0;
    if(y==H){
        return a==0;
    }
    if(x==W){
        return dfs(0,y+1,a);
    }
    if(used[x][y]){
        return dfs(x+1,y,a);
    }
    if(y+1<H&&!used[x][y+1]&&a>0){
        used[x][y]=used[x][y+1]=true;
        ans+=dfs(x+1,y,a-1);
        used[x][y]=used[x][y+1]=false;
    }
    if(x+1<W&&!used[x+1][y]&&a>0){
        used[x][y]=used[x+1][y]=true;
        ans+=dfs(x+1,y,a-1);
        used[x][y]=used[x+1][y]=false;
    }
    ans+=dfs(x+1,y,a);
    return ans;
}
int main(){
    ll h,w,a,b;
    cin>>H>>W>>A>>B;
    cout<<dfs(0,0,A)<<endl;
    return 0;
}
