#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int N = 2e5 + 10;
int fac[N];
int mul(int a, int b) { return (1ll * a * b) % mod; }
int npow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    n >>= 1;
  }
  return res;
}
int inv(int a) { return npow(a, mod - 2); }
int C(int n, int k) { return mul(fac[n], inv(mul(fac[k], fac[n - k]))); }
int main() {
  int n, k;
  cin >> n >> k;
  if (k > n - 1) {
    cout << 0 << endl;
    return 0;
  }
  fac[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = mul(fac[i - 1], i);
  }
  long long x = n - k;
  long long ans = 0;
  for (int i = x; i >= 0; i--) {
    if ((i & 1) == (x & 1)) {
      ans = (ans + mul(npow(i, n), C(x, i))) % mod;
    } else {
      ans = (ans - mul(npow(i, n), C(x, i)) + mod) % mod;
    }
  }
  ans = mul(ans, C(n, x));
  if (k > 0) {
    ans = mul(ans, 2);
  }
  cout << ans << endl;
  return 0;
}
