#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define re return
#define all(a) a.begin(),a.end()
#define int long long
#define Type int
#define rept(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,a) rept(i,0,a)
using namespace std;
int n,t;
int a[44];
vector<int>v1,v2;
signed main()
{
	cin>>n>>t;
	rep(i,n)
		cin>>a[i];
	int mid=n/2;
	rep(i,1<<mid){
		int tt=0;
		rep(j,mid)
			if (i>>j&1)
				tt+=a[j];
		if (tt<=t)
			v1.pb(tt);
	}
	rep(i,1<<(n-mid)){
		int tt=0;
		rep(j,n-mid)
			if (i>>j&1)
				tt+=a[j+mid];
		if (tt<=t)
			v2.pb(tt);
	}
	sort(all(v2));
	v2.pb(t+1);
	int ans=0;
	rep(i,sz(v1)){
		int j=upper_bound(all(v2),t-v1[i])-v2.begin()-1;
		ans=max(ans,v1[i]+v2[j]);
	}
	cout<<ans;
	re 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
int seive[200002];
ll mod = 998244353;
ll inv[1000];
ll C(ll a, ll b){
	ll temp = 1;
	for(ll i=0;i<b;i++){
		temp = (temp * (a-i))%mod;
	}
	for(ll i=0;i<b;i++){
		temp = (temp * inv[i+1])%mod;
	}
	return temp;
}
int main()
{
	inv[1] = 1;
	for(int i = 2; i < 1000; ++i)
    	inv[i] = mod - (mod/i) * inv[mod%i] % mod;
    	
	for(int i=0;i<200002;i++){
		seive[i] = -1;
	}
	seive[1]=1;
	for(int i=2;i<200002;i++){
		if(seive[i] == -1){
			seive[i] = i;
		}else{
			continue;
		}
		for(int j=2*i;j<200002;j=j+i){
			if(seive[j]==-1){
				seive[j] = i;
			}
		}
	}
	int n,m;
	cin>>n>>m;
	ll ans = m;
	for(int i=2;i<=m;i++){
		int temp = i;
		int cur = seive[temp];
		ll cnt = 0;
		ll inter = 1;
		while(temp!=1){
			if(cur!=seive[temp]){
				inter = (inter * C(cnt+n-2,cnt))%mod;
				cnt = 0;
				cur = seive[temp];
			}
			temp = temp/seive[temp];
			++cnt;
		}
		inter = (inter * C(cnt+n-2,cnt))%mod;
	//	cout<<inter<<"\n";
		ans = (ans + (m/i)*inter)%mod;
	//	cout<<i<<" ";
	//	cout<<ans<<"\n";
	}
	cout<<ans;
	return 0;
}