""" N=2,6以外で答えは(N-K)!*N-K Aut(SN)の元は全て内部自己同型で、rotateと可換なのはrotateだけなので(?)。 N=2は自明 N=6はわからん。Autが2倍なのでとりあえず2を掛けてみる。当たったらラッキー """ import math N,K=map(int,input().split()) M=998244353 if N==2: print(1) else: ans=math.factorial(N-K)*K%M if N==6: ans=ans*2%M print(ans)