#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const int N = 200010, Mod = 998244353;
inline int read() {
  int s = 0, w = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
int n, K, fac[N + 5], inv[N + 5];
inline int ksc(int x, int p) {
  int res = 1;
  for (; p; p >>= 1, x = 1ll * x * x % Mod)
    if (p & 1) res = 1ll * res * x % Mod;
  return res;
}
inline int C(int x, int y) {
  if (x < y || x < 0 || y < 0) return 0;
  return 1ll * fac[x] * inv[x - y] % Mod * inv[y] % Mod;
}
inline int S(int n, int m) {
  int res = 0;
  for (register int i = 0; i <= m; i++) {
    int w = 1ll * inv[i] * inv[m - i] % Mod * ksc(i, n) % Mod;
    if ((m - i) & 1)
      res = (res - w + Mod) % Mod;
    else
      res = (res + w) % Mod;
  }
  return res;
}
signed main() {
  fac[0] = 1;
  for (register int i = 1; i <= N; i++) fac[i] = 1ll * fac[i - 1] * i % Mod;
  inv[N] = ksc(fac[N], Mod - 2);
  for (register int i = N; i; i--) inv[i - 1] = 1ll * inv[i] * i % Mod;
  n = read();
  long long inp;
  scanf("%lld", &inp);
  if (inp >= 1ll * n) return puts("0") & 0;
  K = (int)inp;
  printf("%d\n", 1ll * C(n, n - K) * fac[n - K] % Mod * S(n, n - K) % Mod *
                     ((K) ? 2 : 1) % Mod);
  return 0;
}
