/*
　　　　　／＞　 フ
　　　　　| 　_　 _|
　 　　　／`ミ _x 彡
　　 　 /　　　 　 |
　　　 /　  ヽ　　 ?
　／￣|　　 |　|　|
　| (￣ヽ＿_ヽ_)_)
　＼二つ
 */
#pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define pf push_front
#define F first
#define S second
#define SS stringstream
#define sqr(x) ((x)*(x))
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define CC(x) cout << (x) << endl
#define AL(x) x.begin(),x.end()
#define pw(x) (1ull<<(x))
#define NMSL cout << "NMSL" << endl;
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define in128 __int128_t
using namespace std;
const int N = 2e6+10;
const int INF = numeric_limits<int>::max() / 4;
const double EPS = 1e-3;
const long double PI = 3.14159265358979323846;
const int mod = 998244353 ;
int fac[N],inv[N];
int n,m;
int ppow(int a,int b=mod-2)
{
    int ans=1%mod;
    a%=mod;
    while(b)
    {
        if(b&1)
            ans=ans*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return ans;
}
void init()
{
    fac[0]=1;
    for(int i=1; i<N; ++i)
        fac[i]=fac[i-1]*i%mod;
    inv[N-1]=ppow(fac[N-1]);
    for(int i=N-2; i>=0; --i)
        inv[i]=(i+1)*inv[i+1]%mod;
}
int C(int n,int m)
{
    if(m<0||m>n)return 0;
    return fac[n]*inv[m]%mod*inv[n-m]%mod;
}
signed main()
{
    fio
    init();
    cin>>n>>m;
    int ans=0;
    for(int i=1; i<=m; ++i)
    {
        int x=i,sum=1;
        vector<int>temp;
        for(int j=2; j*j<=x; ++j)
        {
            int cnt=0;
            while(x%j==0)
            {
                x/=j;
                cnt++;
            }
            if(cnt)
                temp.push_back(cnt);
        }
        if(x>1)temp.push_back(1);
        for(int b : temp)
            sum=sum*C(n+b-1,b)%mod;
        ans=(ans+sum)%mod;
    }cout<<ans;
    return 0;
}

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using std::cout;
using std::cin;
using std::endl;
using ll=long long;
using ld=long double;
ll I=1167167167167167167;
ll Q=998244353;
#define rep(i,a) for (ll i=0;i<a;i++)
template<class T> using _pq = priority_queue<T, vector<T>, greater<T>>;
template<class T> ll LB(vector<T> &v,T a){return lower_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> ll UB(vector<T> &v,T a){return upper_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}else return 0;}
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}else return 0;}
template<class T> void So(vector<T> &v) {sort(v.begin(),v.end());}
template<class T> void Sore(vector<T> &v) {sort(v.begin(),v.end(),[](T x,T y){return x>y;});}
template<class T> void print_tate(vector<T> &v) {rep(i,v.size()) cout<<v[i]<<"\n";}
void yneos(bool a){if(a) cout<<"Yes"<<"\n"; else cout<<"No"<<"\n";}



//おちこんだりもしたけれど、私はげんきです。
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int N;
	cin>>N;
	vector<ll> kai(N+1,1);
	int weigt[N];
	int sum=0;
	rep(i,N) cin>>weigt[i],sum+=weigt[i];
	rep(i,N) kai[i+1]=(kai[i]*(i+1))%Q;
	if(sum%2==1){
		cout<<"0\n";
		return 0;
	}
	ll dp[N+1][sum+1];
  memset(dp,0,sizeof(dp));
	dp[0][0]=1;
	for(int i =0;i < N;i++){
		for(int j=sum/2;j>=weigt[i];j--){
			for(int k=N-1;k>=0;k--) dp[k+1][j]=(dp[k+1][j]+dp[k][j-weigt[i]])%Q;
		}
	}
	ll ans=0;
	for(int i = 0;i < N;i++){
		ans=(ans+(dp[i][sum/2]*((kai[i]*kai[N-i])%Q))%Q)%Q;
	}
	cout<<(ans)%Q<<endl;
}

