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 powermat(a,n): x=len(a) b=[[0 for i in range(3)] for j in range(3)] c=[[0 for i in range(3)] for j in range(3)] for i in range(3): b[i][i]=1 while n: if n%2: for i in range(3): for j in range(3): c[i][j]=0 for i in range(3): for j in range(3): for k in range(3): c[i][j]+=a[i][k]*b[k][j] for i in range(3): for j in range(3): b[i][j]=c[i][j]%mod for i in range(3): for j in range(3): c[i][j]=0 for i in range(3): for j in range(3): for k in range(3): c[i][j]+=a[i][k]*a[k][j] for i in range(3): for j in range(3): a[i][j]=c[i][j]%mod n//=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) a[0][0]+=y a[0][0]+=n*(n+1)//2 a[1][1]+=y; a[1][1]+=n*(n+1)//2 a[1][0]+=x a[0][1]+=x a=powermat(a,q) ans+=a[0][2] print(ans*modpow(2,mod-2,mod)%mod)