mod=998244353 def modpow(a,b,m): res=1 while b: if b%2: res*=a res%=m a*=a a%=m b//=2 return res def prodmat(a,b): x,y,z=len(a),len(b[0]),len(b) c=[[0 for i in range(y)] for j in range(x)] for i in range(x): for j in range(y): for k in range(z): c[i][k]+=a[i][j]*b[j][k] c[i][k]%=mod return c def powermat(a,k): x=len(a) b=[[0 for i in range(x)] for j in range(x)] for i in range(x): b[i][i]=1 while k: if k%2: b=prodmat(b,a) a=prodmat(a,a) k//=2 return b n,q=map(int,input().split()) ans=0 for i in range(1,n): x=i*(n-i+1) y=n*(n+1)//2-x z=(n-i)*(n-i+1)*(n-i+2)//6 x%=mod y%=mod z%=mod a=[[0 for i in range(3)] for j in range(3)] a[1][2]+=z a[2][2]+=n*(n+1)%mod a[0][0]+=y a[0][0]+=n*(n+1)//2%mod a[1][1]+=y a[1][1]+=n*(n+1)//2%mod a[1][0]+=x a[0][1]+=x a=powermat(a,q) ans+=a[0][2] print(ans*modpow(2,mod-2,mod)%mod)