#include <bits/stdc++.h>
using namespace std;
std::mt19937 rnd(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 200000;
const int MOD = 998244353;
void inc(int& a, int b) {
  if ((a += b) >= MOD) a -= MOD;
}
int pw(int x, int n) {
  int ret = 1;
  while (true) {
    if (n & 1) ret = (long long)ret * x % MOD;
    if ((n >>= 1) == 0) return ret;
    x = (long long)x * x % MOD;
  }
}
int n;
long long npairs;
int inv[2 * MAXN + 1];
int fac[2 * MAXN + 1];
int ifac[2 * MAXN + 1];
int choose(int n, int k) {
  if (k < 0 || k > n) return 0;
  return (long long)fac[n] * ifac[k] % MOD * ifac[n - k] % MOD;
}
int solve() {
  if (npairs >= n) return 0;
  inv[1] = 1;
  for (int i = (2); i <= (2 * n); ++i)
    inv[i] = (long long)(MOD - MOD / i) * inv[MOD % i] % MOD;
  fac[0] = 1;
  for (int i = (1); i <= (2 * n); ++i) fac[i] = (long long)fac[i - 1] * i % MOD;
  ifac[0] = 1;
  for (int i = (1); i <= (2 * n); ++i)
    ifac[i] = (long long)ifac[i - 1] * inv[i] % MOD;
  int nzero = npairs;
  int npos = n - nzero;
  int ret = 0;
  for (int i = (0); i < (npos); ++i) {
    int cur = pw(npos - i, n);
    cur = (long long)cur * choose(npos, i) % MOD;
    if (i % 2 == 0)
      inc(ret, cur);
    else
      inc(ret, MOD - cur);
  }
  ret = (long long)ret * choose(n, npos) % MOD;
  if (nzero != 0) ret = (long long)ret * 2 % MOD;
  return ret;
}
void run() {
  scanf("%d%lld", &n, &npairs);
  printf("%d\n", solve());
}
int main() {
  run();
  return 0;
}
