#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
const long long mod = 998244353;
long long lgp(long long a, long long b) {
  long long res = 1, pop = a;
  for (long long i = 0; (1 << i) <= b; i++) {
    if (b & (1 << i)) res = (res * pop) % mod;
    pop = (pop * pop) % mod;
  }
  return res;
}
long long ans, fact[200005];
long long c(long long n, long long k) {
  long long rs = fact[n];
  rs = (rs * lgp(fact[k], mod - 2)) % mod;
  rs = (rs * lgp(fact[n - k], mod - 2)) % mod;
  return rs;
}
long long n, k;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  srand(chrono::steady_clock::now().time_since_epoch().count());
  cin >> n >> k;
  if (k > n) return cout << 0, 0;
  k = (n - k);
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  for (long long i = 0; i <= k; i++) {
    ans = (ans + lgp(-1, i) * lgp(k - i, n) % mod * c(k, i)) % mod;
    if (ans < 0) ans += mod;
  }
  ans = (ans * c(n, k)) % mod;
  if (k != n) ans = (ans * 2) % mod;
  return cout << ans, 0;
}
