#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vvin=vector<vin>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=1e9+7;
const ll INF=9e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

int main(){cout<<fixed<<setprecision(20);
		   //半分全列挙
           int n;
           ll x;
           cin>>n>>x;
           vll w(n);
           rep(i,0,n)cin>>w[i];
           vll cnt_l,cnt_r;
           int l=n/2;
           int r=n-l;

           for(int bid=0;bid<(1<<l);bid++){
             ll sum=0;
             rep(i,0,l){
               if(bid & (1<<i))sum+=w[i];
             }
             cnt_l.pb(sum);
           }

           for(int bid=0;bid<(1<<r);bid++){
            ll sum=0;
             rep(i,0,r){
              if(bid & (1<<i))sum+=w[l+i];
             }
             cnt_r.pb(-sum);
           }
           sort(all(cnt_r));
           sort(all(cnt_l));
           ll ans=0;
           for(auto v:cnt_l){
               ll t=v;
             ll p=*lower_bound(cnt_r.begin(), cnt_r.end(), t-x);
             if(t-p>x)continue;
             chmax(ans,t-p);
           }
           cout<<ans<<endl;
}


//伟大的导师，伟大的领袖，伟大的统帅，伟大的舵手
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef long long ll;
char __buf[1<<20],*__p1,*__p2;
//#define getchar() (__p1==__p2?(__p2=__buf+fread(__p1=__buf,1,1<<20,stdin),__p1==__p2?EOF:*__p1++):*__p1++)
int read() {
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
	return s*w;
}
const int maxn = 110, mod = 998244353;
int n,f[maxn][maxn*maxn],s,w[maxn],ans,pw[maxn];
signed main() {
	n=read(),f[0][0]=1;
	pw[0]=1;for(int i=1;i<=n;i++) pw[i]=1ll*pw[i-1]*i%mod;
	for(int i=1;i<=n;i++) s+=(w[i]=read());
	if(s&1) return cout<<0<<'\n',0;s/=2;
	for(int i=1;i<=n;i++)
		for(int j=i;j;j--)
			for(int k=s;k>=w[i];k--) f[j][k]=(f[j][k]+f[j-1][k-w[i]])%mod;
	for(int i=1;i<=n;i++) ans=(ans+1ll*pw[i]*pw[n-i]%mod*f[i][s])%mod;
	cout<<ans<<'\n';
	return 0;
}