#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int N = 2e6 + 1;
const long long mod = 998244353;
long long fact[N];
long long power(long long x, long long n) {
  long long res = 1;
  x %= mod;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
long long modInv(long long n) { return power(n, mod - 2); }
long long ncr(long long n, long long r) {
  if (n < 0 || r < 0 || r > n) return 0;
  long long num = fact[n];
  long long denom = (fact[n - r] * fact[r]) % mod;
  return (num * modInv(denom)) % mod;
}
void pre() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
}
void solve() {
  long long n, k;
  cin >> n >> k;
  long long y = n - k;
  if (y < 0) {
    cout << 0 << "\n";
    return;
  }
  long long ans = ncr(n, y);
  long long sum = 0;
  for (int i = 0; i <= y; i++) {
    long long temp = (ncr(y, y - i) * power(y - i, n)) % mod;
    if (i % 2) {
      sum = (sum + mod - temp) % mod;
    } else {
      sum = (sum + temp) % mod;
    }
  }
  ans = (ans * sum) % mod;
  if (y != n) {
    ans = (ans * 2) % mod;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  std::cout << std::fixed << std::setprecision(20);
  ;
  int t = 1;
  pre();
  while (t--) {
    solve();
  }
}
