#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200200, MOD = 998244353;
long long n, k;
int fact[MAXN];
int powmod(int b, int e) {
  if (!e) return 1;
  if (e & 1) return 1LL * b * powmod(b, e - 1) % MOD;
  int aux = powmod(b, e >> 1);
  return 1LL * aux * aux % MOD;
}
inline int inv(int x) { return powmod(x, MOD - 2); }
inline int choose(int a, int b) {
  return 1LL * (1LL * fact[a] * inv(fact[b]) % MOD) * inv(fact[a - b]) % MOD;
}
int main() {
  scanf("%lld %lld", &n, &k);
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) fact[i] = 1LL * fact[i - 1] * i % MOD;
  if (k >= n) printf("0\n"), exit(0);
  if (k == 0) printf("%d\n", fact[n]), exit(0);
  int ans = 0;
  for (int i = 0, x; i <= n - k; ++i) {
    x = 1LL * choose(n - k, i) * powmod(n - k - i, n) % MOD;
    if (i % 2)
      ans = (MOD + 0LL + ans - x) % MOD;
    else
      ans = (0LL + ans + x) % MOD;
  }
  ans = 1LL * ans * choose(n, k) % MOD;
  printf("%d\n", 2LL * ans % MOD);
}
