#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 5;
const long long mod = 998244353;
long long pw(long long b, long long r, long long md = mod) {
  b = b % md;
  long long ans = 1;
  while (r) {
    if (r & 1) ans = (ans * b) % md;
    b = (b * b) % md;
    r >>= 1;
  }
  return ans;
}
const long long N = 2e5 + 5;
long long fact[N];
void init(long long n) {
  fact[0] = 1;
  for (long long i = 1; i <= n; ++i) fact[i] = (i * fact[i - 1]) % mod;
}
long long ncr(long long n, long long r) {
  long long ans = fact[n];
  long long den = (fact[r] * (fact[n - r])) % mod;
  den = pw(den, mod - 2);
  ans *= den;
  ans %= mod;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long T = 1;
  while (T--) {
    long long n, k;
    cin >> n >> k;
    init(n);
    if (k > n - 1) {
      cout << 0 << '\n';
      continue;
    }
    if (k == 0) {
      cout << fact[n] << '\n';
      continue;
    }
    long long ans = pw(n - k, n);
    long long ans2 = 0;
    for (long long i = 1; i <= n - k; ++i) {
      long long c = ncr(n - k, i);
      c *= pw(n - k - i, n);
      c %= mod;
      if (i & 1)
        ans2 += c;
      else
        ans2 -= c;
      ans2 %= mod;
      if (ans2 < 0) ans2 += mod;
    }
    ans -= ans2;
    ans %= mod;
    if (ans < 0) ans += mod;
    ans *= 2;
    ans %= mod;
    ans *= ncr(n, n - k);
    ans %= mod;
    cout << ans << '\n';
  }
  return 0;
}
