#include <bits/stdc++.h>
using namespace std;
const long long M = 998244353;
long long f1[200001], f2[200001];
long long expo(long long a, long long b) {
  long long ans = 1;
  for (; b; a = (a * a % M + M) % M, b >>= 1) {
    if (b & 1) ans *= a;
    ans %= M;
    if (ans < 0) ans += M;
  }
  return ans;
}
long long nCr(long long n, long long r) {
  return (((f1[n] * f2[n - r] % M + M) % M * f2[r] + M) % M);
}
int main() {
  long long n, k;
  cin >> n >> k;
  if (k >= n)
    cout << 0;
  else {
    f1[0] = 1;
    for (long long i = 1; i <= n; i++) f1[i] = ((f1[i - 1] * i) % M + M) % M;
    f2[0] = 1;
    for (long long i = 1; i <= n; i++) f2[i] = expo(f1[i], M - 2);
    long long fact = 0;
    for (int i = 0; i < n - k; i++) {
      fact +=
          ((i & 1 ? -1 : 1) * nCr(n - k, i) + M) % M * expo(n - k - i, n) % M;
      fact %= M;
      if (fact < 0) fact += M;
    }
    long long ans = nCr(n, k) * fact % M;
    if (ans < 0) ans += M;
    cout << (ans * (k != 0 ? 2 : 1) % M + M) % M;
  }
  return 0;
}
