#include <bits/stdc++.h>
const int N = 200010;
const long long mod = 998244353ll;
class NumberFunction {
 public:
  long long Pow(long long a, long long b) {
    long long ans = 1ll;
    for (long long tmp = a; b;) {
      if (b & 1) {
        ans = (ans * tmp) % mod;
      }
      tmp = (tmp * tmp) % mod;
      b >>= 1ll;
    }
    return ans;
  }
  long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
} nf;
class NumberPreprocess {
 public:
  NumberPreprocess() {}
  void FactorialWithInv(int n) {
    fac[0] = 1ll;
    fac_inv[0] = nf.Pow(fac[0], mod - 2ll);
    for (int i = 1; i <= n; ++i) {
      fac[i] = fac[i - 1] * (long long)i % mod;
      fac_inv[i] = nf.Pow(fac[i], mod - 2ll);
    }
  }
  long long Fac(int n) { return fac[n]; }
  long long C(int a, int b) {
    if (b < 0 || a < 0 || b > a) {
      return 0ll;
    }
    return ((fac[a] * fac_inv[b]) % mod * fac_inv[a - b]) % mod;
  }
  void InverseElement(int n) {
    inv[1] = 1ll;
    for (int i = 2; i <= n; ++i) {
      inv[i] = (mod - mod / i) * inv[mod % i] % mod;
    }
  }
  long long Inv(int i) { return inv[i]; }

 private:
  long long fac[N];
  long long fac_inv[N];
  long long inv[N];
} np;
int n, k;
long long ans;
int main() {
  scanf("%d%d", &n, &k);
  np.FactorialWithInv(n);
  if (k == 0) {
    printf("%lld\n", np.Fac(n));
    return 0;
  }
  for (int i = 0; i <= n - k; ++i) {
    long long tmp = np.C(n - k, i) * nf.Pow(n - k - i, n) % mod;
    if (i & 1) {
      ans = (ans - tmp + mod) % mod;
    } else {
      ans = (ans + tmp) % mod;
    }
  }
  ans = (ans * np.C(n, k)) % mod;
  printf("%lld\n", (ans * 2ll) % mod);
  return 0;
}
