#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 998244353;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll n, w[101], ex[101], sm, dp[2][100 * 101][101];

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    
    cin >> n;
    zep(i, 0, n)cin >> w[i];

    ex[0] = 1;
    rep(i, 1, n)ex[i] = i * ex[i - 1] % MOD;

    zep(i, 0, n)sm += w[i];
    if(sm % 2 == 1){print(0) return 0;}

    dp[0][0][0] = 1;
    zep(i, 0, n){
        memset(dp[(i + 1) % 2], 0, sizeof(dp[(i + 1) % 2]));

        rep(j, 0, sm / 2){
            rep(k, 0, i){
                dp[(i + 1) % 2][j][k] += dp[i % 2][j][k];
                dp[(i + 1) % 2][j][k] %= MOD;
                dp[(i + 1) % 2][j + w[i]][k + 1] += dp[i % 2][j][k];
                dp[(i + 1) % 2][j + w[i]][k + 1] %= MOD;
            }
        }
    }
    
    ll ans = 0;
    zep(k, 1, n){
        ans += dp[n % 2][sm / 2][k] * (ex[k] * ex[n - k] % MOD) % MOD;
        ans %= MOD;
    }
    print(ans)

    return 0;
}
#include <bits/stdc++.h>

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

#ifdef LOCAL
#define log(val) std::cerr << std::setw(3) << __LINE__ << "| " << #val << " = " << (val) << std::endl
#define dbg(proc) proc
#else
#define log(val) 0
#define dbg(proc) 0
#endif

template <typename T>
std::ostream& operator<<(std::ostream& os,const std::vector<T>& v){os << "{";if(!v.empty()){os << v[0];for(std::size_t i=1;i<v.size();++i){os << ", " << v[i];}}return os << "}";}

using ll = std::int64_t;
using P = std::tuple<int,int>;

constexpr int INF = 1001001001;
int N;
ll X;
int A[110];
int dp[110][110][110];

int main(){
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    std::cin >> N >> X;

    for(int i=0;i<N;++i){
        std::cin >> A[i];
    }

    ll res = std::numeric_limits<ll>::max();

    for(int k=1;k<=N;++k){
        std::fill(&dp[0][0][0], &dp[0][0][0] + 110 * 110 * 110, -INF);
        dp[0][0][0] = 0;
        
        for(int i=0;i<N;++i){
            for(int j=0;j<=k;++j){
                for(int r=0;r<k;++r){
                    dp[i+1][j][r] = std::max(dp[i+1][j][r], dp[i][j][r]);
                    if(j + 1 <= k){
                        dp[i+1][j+1][(r+A[i])%k] = std::max(dp[i+1][j+1][(r+A[i])%k], dp[i][j][r] + A[i]);
                    }
                }
            }
        }

        if(dp[N][k][X%k] < 0){
            continue;
        }

        res = std::min(res, (X - dp[N][k][X%k]) / k);
    }

    std::cout << res << std::endl;
}
