#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5;
const long long mod = 998244353;
long long factor[maxn + 10];
long long invFactor[maxn + 10];
long long quick_pow(long long a, long long b, long long mod) {
  long long ans = 1, base = a;
  while (b != 0) {
    if (b & 1) ans = (long long)ans * base % mod;
    base = (long long)base * base % mod;
    b >>= 1;
  }
  return ans;
}
long long C(long long n, long long m) {
  if (n < 0 || m < 0 || n < m) return 0;
  long long sum = factor[n];
  sum = (long long)sum * invFactor[n - m] % mod;
  sum = (long long)sum * invFactor[m] % mod;
  return sum;
}
void init() {
  factor[0] = 1;
  for (int i = 1; i <= maxn; i++) factor[i] = i * factor[i - 1] % mod;
  invFactor[maxn] = quick_pow(factor[maxn], mod - 2, mod);
  for (int i = maxn; i >= 1; i--) invFactor[i - 1] = invFactor[i] * i % mod;
}
void solve() {
  init();
  long long n, k;
  scanf("%lld%lld", &n, &k);
  if (k == 0) {
    printf("%lld\n", factor[n]);
    return;
  }
  if (k >= n) {
    printf("0\n");
    return;
  }
  long long ans = 0;
  for (long long i = 0; i <= n - k; i++) {
    long long sum = C(n - k, i);
    sum = (long long)sum * quick_pow(n - i - k, n, mod) % mod;
    if (i & 1) {
      sum = mod - sum;
    }
    ans = (long long)(ans + sum) % mod;
  }
  ans = (long long)ans * C(n, n - k) % mod;
  ans = (long long)ans * 2 % mod;
  printf("%lld\n", ans);
}
int main() {
  solve();
  return 0;
}
