#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int maxm = 3e6 + 5;
const long long mod = 998244353;
long long fac[maxn];
long long inv[maxn];
long long fpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
void get(int n) {
  fac[0] = 1;
  for (long long i = 1ll; i < maxn; ++i) fac[i] = fac[i - 1] * i % mod;
  inv[n] = fpow(fac[n], mod - 2);
  for (long long i = n - 1; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
}
long long C(int n, int m) { return fac[n] * inv[m] % mod * inv[n - m] % mod; }
int main() {
  int n;
  long long k;
  scanf("%d%lld", &n, &k);
  get(n);
  if (k == 0) {
    printf("%lld\n", fac[n]);
  } else if (k >= n) {
    puts("0");
  } else {
    long long ans = 0, f = 1ll;
    for (int i = 0; i < n - k; ++i, f = -f) {
      ans = (ans + f * fpow(n - k - i, n) * C(n - k, i) % mod) % mod;
    }
    ans = ((2ll * ans % mod * C(n, n - k) % mod) + mod) % mod;
    printf("%lld\n", ans);
  }
  return 0;
}
