#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, ans = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return f * ans;
}
const long long MAXN = 2e5 + 11;
long long fac[MAXN], ifac[MAXN], inv[MAXN], N, M, Ans;
long long binom(long long a, long long b) {
  return a < b ? 0 : fac[a] * ifac[b] % 998244353 * ifac[a - b] % 998244353;
}
long long ksm(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans *= a, ans %= 998244353;
    a *= a, a %= 998244353;
    b >>= 1;
  }
  return ans;
}
signed main() {
  N = read(), M = read();
  fac[0] = ifac[0] = fac[1] = ifac[1] = inv[1] = 1;
  for (long long i = 2; i <= N; i++)
    fac[i] = fac[i - 1] * i % 998244353,
    inv[i] = (998244353 - 998244353 / i) * inv[998244353 % i] % 998244353,
    ifac[i] = ifac[i - 1] * inv[i] % 998244353;
  if (!M) {
    printf("%lld\n", fac[N]);
    return 0;
  }
  long long res = 0;
  for (long long i = 0; i <= N - M; i++) {
    long long opt = ((N - M - i) & 1 ? 998244353 - 1 : 1);
    Ans += opt * binom(N - M, i) % 998244353 * ksm(i, N) % 998244353;
    Ans %= 998244353;
  }
  Ans *= binom(N, M), Ans %= 998244353;
  printf("%lld\n", Ans * 2 % 998244353);
}
