#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
constexpr ll TEN(int n){return (n==0) ? 1 : 10 * TEN(n-1);}
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,N) for(int i=0;i<(int)(N);i++)
#define rep1(i,N) for(int i=1;i<=(int)(N);i++)
#define fs first
#define sc second
#define eb emplace_back
#define pb eb
#define all(x) x.begin(),x.end()
template<class T, class U> void chmin(T& t, const U& u){ if(t>u) t = u;}
template<class T, class U> void chmax(T& t, const U& u){ if(t<u) t = u;}

#ifdef LOCAL
#define show(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define show(x) true
#endif

template<class T,class U>
ostream& operator<<(ostream& os, const pair<T,U>& p){
    return os << "P(" << p.fs << ", " << p.sc << ")";
}
template<class T> ostream& operator<<(ostream& os, const V<T>& v){
    os << "[";
    for(auto d: v) os << d << ", ";
    return os << "]";
}
template<unsigned int mod_>
struct ModInt{
    using M = ModInt;
    constexpr static uint mod = mod_;
    uint v;
    ModInt():v(0){}
    ModInt(ll _v):v(normS(_v%mod+mod)){}
    explicit operator bool() const {return v!=0;}
    static uint normS(const uint&x){return (x<mod)?x:x-mod;}
    static M make(const uint&x){M m;m.v=x;return m;}
    M operator+(const M& b) const {return make(normS(v+b.v));}
    M operator-(const M& b) const {return make(normS(v+mod-b.v));}
    M operator-() const {return make(normS(mod-v));}
    M operator*(const M& b) const {return make((ull)v*b.v%mod);}
    M operator/(const M& b){return *this*b.inv();}
    M& operator+=(const M& b){return *this=*this+b;}
    M& operator-=(const M& b){return *this=*this-b;}
    M& operator*=(const M& b){return *this=*this*b;}
    M& operator/=(const M& b){return *this=*this/b;}
    ll extgcd(ll a,ll b,ll &x,ll& y) const {
        ll p[]={a,1,0},q[]={b,0,1};
        while(*q){
            ll t=*p/ *q;
            rep(i,3) swap(p[i]-=t*q[i],q[i]);
        }
        if(p[0]<0) rep(i,3) p[i] = -p[i];
        x = p[1], y = p[2];
        return p[0];
    }
    ModInt inv() const {
        ll x,y;
        extgcd(v,mod,x,y);
        return make(normS(x+mod));
    }
    M pow(ll p) const {
        if(p<0) return inv().pow(-p);
        M a = 1;
        M x = *this;
        while(p){
            if(p&1) a *= x;
            x *= x;
            p /= 2;
        }
        return a;
    }
    bool operator==(const M& b) const {return v == b.v;}
    bool operator!=(const M& b) const {return v != b.v;}
    friend ostream& operator<<(ostream &o, const M& x){return o<<x.v;}
};
using mint = ModInt<998244353>;

template<class T>
T interpolate(V<T> xs, V<T> ys, T x){
    int N = xs.size();
    rep(i,N){
        if(xs[i] == x) return ys[i];
    }
    T ret = 0;
    rep(i,N){
        T a = ys[i];
        rep(j,N) if(j!=i) a *= (x-xs[j])/(xs[i]-xs[j]);
        ret += a;
    }
    return ret;
}
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N,S_;
    cin >> N >> S_;
    mint S(S_);

    mint ans = (S+1)*S/2 * (S+1).pow(N-2);
    {
        V<mint> xs,ys;
        rep(i,N+10){
            int x = i*2 + S_%2;
            mint y = 0;
            for(int m=1;m<=x;m+=2){
                y += mint(x+1-m).pow(N-1) - mint(x-m).pow(N-1);
            }
            xs.pb(x);ys.pb(y);
        }
        ans += interpolate(xs,ys,S);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3216