#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define vi vector<int>
#define vvi vector<vector<int>>
#define pb push_back
#define pii pair<ll,ll>
#define tii tuple<ll,ll,ll>
#define all(v) (v).begin(),(v).end()
#define ll long long
#define ull unsigned long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(nullptr);
#define ld long double
#define mod 998244353
#define PI 3.141592653589793238
#define eps 1e-9
#define endl "\n"
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;   

void solve() {
    ll n;
    cin>>n;
    vector<ll> vec(n);
    for(auto& it : vec) cin>>it;

    sort(all(vec));

    ll last = vec[0];
    ll sum = vec[0]*vec[0];
    for(int i = 1; i < n; ++i) {
        last = (last * 2 + vec[i] - vec[i-1] + mod) % mod;
        sum = ((sum%mod) + (last%mod) * (vec[i])) % mod;
    }
    cout<<sum%mod<<endl;
}

int32_t main()  {
    fastio
    int t = 1;
    //cin>>t;
    while(t--) 
        solve();
}
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,K;
const ll mo=998244353;

int dp[3030][3030];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>K;
	dp[K][K]=1;
	
	for(i=K;i<N;i++) {
		for(y=1;y<=N;y++) if(dp[i][y]) {
			for(x=1;x<=y&&i+x<=N;x++) {
				dp[i+x][2*x]+=dp[i][y];
				if(dp[i+x][2*x]>=mo) dp[i+x][2*x]-=mo;
			}
		}
	}
	ll ret=0;
	FOR(i,N+1) ret+=dp[N][i];
	cout<<ret%mo<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
