#include <bits/stdc++.h>
using namespace std;
int INF = 998244353;
vector<int> fact;
int mul(int a, int b) { return 1ll * a * b % INF; }
int binpow(int a, int n) {
  int ans = 1;
  int mult = a;
  for (; n > 0; n >>= 1) {
    if (n & 1) ans = mul(ans, mult);
    mult = mul(mult, mult);
  }
  return ans;
}
int inv(int a) { return binpow(a, INF - 2); }
int binom(int n, int k) { return mul(fact[n], inv(mul(fact[k], fact[n - k]))); }
int truemod(int a, int b) {
  if (a >= 0)
    return a % b;
  else
    return (b + a % b) % b;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  if (k > n) {
    cout << 0;
    return 0;
  }
  fact = vector<int>(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; i++) fact[i] = mul(i, fact[i - 1]);
  int c = n - k;
  long long ans = 0;
  for (int i = 0, p = 1; i <= c; i++, p *= -1)
    ans = truemod((ans + p * mul(binom(c, i), binpow(c - i, n))), INF);
  ans = mul(ans, binom(n, c));
  if (k != 0) (ans *= 2) %= INF;
  cout << ans;
}
