#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353, N = 210000;
int n;
long long k, fac[N], inv[N], f[N];
inline int addMod(int a, int b) { return (a += b) >= mod ? a - mod : a; }
inline long long quickpow(long long base, long long pw) {
  long long ret = 1;
  while (pw) {
    if (pw & 1) ret = ret * base % mod;
    base = base * base % mod, pw >>= 1;
  }
  return ret;
}
template <class T>
inline void read(T &x) {
  x = 0;
  char ch = getchar(), w = 0;
  while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  x = w ? -x : x;
  return;
}
inline void initComb(int n) {
  fac[0] = 1;
  for (register int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % mod;
  inv[n] = quickpow(fac[n], mod - 2);
  for (register int i = n; i; --i) inv[i - 1] = inv[i] * i % mod;
}
inline long long comb(int n, int m) {
  if (n < m || m < 0) return 0;
  return fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  read(n), read(k);
  if (k >= n) return printf("0\n"), 0;
  initComb(n);
  long long ans = 0;
  for (register int i = 0; i <= n - k; ++i) {
    long long w = comb(n, i) * quickpow(i, n) % mod * comb(n - i, k) % mod;
    ans = addMod(ans, (n - k - i) & 1 ? mod - w : w);
  }
  cout << (k ? addMod(ans, ans) : ans) << '\n';
  return 0;
}
