#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int mod = 998244353;
int n, fac[N], inv[N];
long long k;
template <typename T>
inline void IN(T& x) {
  char ch;
  bool flag = 0;
  x = 0;
  while (ch = getchar(), !isdigit(ch))
    if (ch == '-') flag = 1;
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  if (flag) x = -x;
}
inline int modpow(int x, int y, int res = 1) {
  for (; y; y >>= 1, x = 1ll * x * x % mod)
    if (y & 1) res = 1ll * res * x % mod;
  return res;
}
inline int C(int n, int m) {
  return 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  IN(n), IN(k);
  if (k > n - 1) return puts("0"), 0;
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % mod;
  for (int i = 1; i <= n; ++i) inv[i] = modpow(fac[i], mod - 2);
  int ans = 0, lim = n - k;
  for (int i = lim; i >= 0; --i)
    if (i % 2 == lim % 2)
      ans = (ans + 1ll * modpow(i, n) * C(lim, i) % mod) % mod;
    else
      ans = (ans - 1ll * modpow(i, n) * C(lim, i) % mod + mod) % mod;
  ans = 1ll * ans * C(n, lim) % mod;
  if (k > 0) ans = 2ll * ans % mod;
  return printf("%d\n", ans), 0;
}
