#include <bits/stdc++.h>
using namespace std;
class DebugStream {
} LOG;
template <typename T>
DebugStream &operator<<(DebugStream &s, const T &) {
  return s;
}
const int MAX = 500500;
const long long mod = 998244353;
long long mpow(long long n, long long p) {
  if (p == 0) return 1ll;
  long long aux = mpow(n, p / 2);
  aux = (aux * aux) % mod;
  if (p % 2 == 1) aux = (n * aux) % mod;
  return aux;
}
long long inv(long long n) {
  n %= mod;
  return mpow(n, mod - 2);
}
long long f[MAX], f_inv[MAX];
void init() {
  f[0] = 1;
  f_inv[0] = 1;
  for (long long i = 1; i < MAX; i++) {
    f[i] = (i * f[i - 1]) % mod;
    f_inv[i] = inv(f[i]);
  }
}
long long bin(int n, int k) {
  if (k < 0 || k > n) return 0;
  long long ans = (f[n] * f_inv[k]) % mod;
  ans = (ans * f_inv[n - k]) % mod;
  return ans;
}
int main() {
  init();
  int n, k;
  scanf("%d %d", &n, &k);
  int F = n - k;
  if (F < 1 || F > n)
    printf("%lld\n", 0ll);
  else if (F == n) {
    printf("%lld\n", f[F]);
  } else {
    long long ans = 0;
    for (int t = 1; t <= F; t++) {
      long long y = (mpow(t, n) * bin(F, t)) % mod;
      if (F % 2 != t % 2) y = (mod - y) % mod;
      ans = (ans + y) % mod;
    }
    ans = (ans * bin(n, F)) % mod;
    ans = (2ll * ans) % mod;
    printf("%lld\n", ans);
  }
}
