#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return;
}
inline void out(long long x) {
  if (x > 9) out(x / 10);
  putchar(x % 10 + '0');
}
const int mod = 998244353;
const int maxn = 2e5 + 10;
long long fac[maxn] = {0};
long long quickpow(long long a, long long b) {
  long long ans = 1, base = a;
  while (b) {
    if (b & 1) ans = ans * base % mod;
    base = base * base % mod;
    b >>= 1;
  }
  return ans;
}
long long C(long long n, long long m) {
  return fac[n] * quickpow(fac[m] * fac[n - m] % mod, mod - 2) % mod;
}
int main() {
  long long ans = 0, n, k;
  read(n), read(k);
  if (k > n - 1) {
    out(0);
    return 0;
  }
  fac[0] = fac[1] = 1;
  long long m = n - k;
  for (int i = 2; i < maxn; i++) fac[i] = (fac[i - 1] * i) % mod;
  for (int i = 0; i <= m; i++) {
    if (i % 2 == 0)
      ans += C(m, i) * quickpow(m - i, n) % mod;
    else
      ans = ans - C(m, i) * quickpow(m - i, n) % mod + mod;
    ans %= mod;
  }
  ans = (ans * C(n, m)) % mod;
  if (k) ans = (ans << 1) % mod;
  out(ans);
  return 0;
}
