#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define ud unsigned int
#define ll long long
#define ull unsigned long long
#define MAX_INF 0x3f
#define MAX_INF_VAL 0x3f3f3f3f
#define MAX_INF_VAL_LL 0x3f3f3f3f3f3f3f3f
//#define pi 3.141592653589
#define eps 1e-9
#define F(x) ((x)/3+((x)%3==1?0:tb))
#define G(x) ((x)<tb?(x)*3+1:((x)-tb)*3+2)
//#define p 2173412051LL
//#define sz 2

using namespace std;

template< typename T > void read( T &x ) {
	x = 0;
	char ch = getchar();
	ll f = 1;
	while( !isdigit( ch ) ) {
		if( ch == '-' )
		f *= -1;
		ch = getchar();
	}
	while( isdigit( ch ) ) {
		x = x * 10 + ch - 48;
		ch = getchar();
	}
	x *= f;
}

struct custom_hash {
    static uint64_t splitmix64( uint64_t x ) {
        x += 0x9e3779b97f4a7c15;
        x = ( x ^ ( x >> 30 ) ) * 0xbf58476d1ce4e5b9;
        x = ( x ^ ( x >> 27 ) ) * 0x94d049bb133111eb;
        return x ^ ( x >> 31 );
    }

    size_t operator() ( uint64_t x ) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64( x + FIXED_RANDOM );
    }
};

const ll p = 998244353;

int a[ 110 ];
ll f[ 110 ][ 10010 ];
ll fac[ 110 ];

int main() {
	ios::sync_with_stdio( false );
	cin.tie( 0 ), cout.tie( 0 );
	int n;
	cin >> n;
	fac[ 0 ] = 1;
	ll sum = 0;
	for( int i = 1; i <= n; ++i ) {
		cin >> a[ i ];
		fac[ i ] = fac[ i - 1 ] * i % p;
		sum += a[ i ];
	}
	if( sum & 1 ) {
		cout << 0;
		return 0;
	}
	sum >>= 1;
	f[ 0 ][ 0 ] = 1;
	for( int i = 1; i <= n; ++i ) {
		for( int j = i; j; --j ) {
			for( int k = j * 100; k >= a[ i ]; --k )
				f[ j ][ k ] = ( f[ j ][ k ] + f[ j - 1 ][ k - a[ i ] ] ) % p;
		}
	}
	ll ans = 0;
	for( int i = 1; i <= n; ++i )
		ans = ( ans + fac[ i ] * f[ i ][ sum ] % p * fac[ n - i ] ) % p;
	cout << ans;
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<ll(n);i++)
#define REP(i,k,n) for(ll i=k;i<ll(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define UNIQUE(a) sort(all(a));a.erase(unique(all(a)),a.end())
#define decimal cout<<fixed<<setprecision(10)
#define summon_tourist cin.tie(0);ios::sync_with_stdio(false)
using ll=long long;
using P=pair<ll,ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
constexpr ll inf=1001001001001001;
constexpr int INF=1001001001;
constexpr int mod=998244353;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
void YesNo(bool b){if(b)out("Yes");else out("No");}
void yesno(bool b){if(b)out("yes");else out("no");}
void YESNO(bool b){if(b)out("YES");else out("NO");}
ll modpow(ll a,ll b){ll c=1;while(b>0){if(b&1){c=a*c%mod;}a=a*a%mod;b>>=1;}return c;}
vi calc(ll x){vi v;while(x>0){v.eb(x%10);x/=10;}reverse(all(v));return v;}

vector<P> p_fac(ll n){
	vector<P> res;
	for(ll a=2;a*a<=n;a++){
		if(n%a!=0) continue;
		ll ex=0; //exponent number
		while(n%a==0){
			ex++; n/=a;
		}
		res.eb(make_pair(a,ex));
	}
	if(n!=1) res.eb(make_pair(n,1));
	return res;
}

const ll max_n=205000; //please define
vi fac(max_n),finv(max_n),inv(max_n);
// O(max_n)
void init(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    REP(i,2,max_n){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}
// O(1)
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}

int main(){
    init();
	ll n,m;
	cin>>n>>m;
    ll ans=1;
	REP(i,2,m+1){
        vector<P> v=p_fac(i);
        ll c=1;
        rep(j,v.size()){
            ll x=v[j].se;
            c*=COM(x+n-1,x);
            c%=mod;
        }
        ans+=c;
        ans%=mod;
	}
    out(ans);
}