#include <bits/stdc++.h>
using namespace std;
int N;
signed long long K;
const signed long long mo = 998244353;
signed long long modpow(signed long long a, signed long long n = mo - 2) {
  signed long long r = 1;
  a %= mo;
  while (n) r = r * ((n % 2) ? a : 1) % mo, a = a * a % mo, n >>= 1;
  return r;
}
signed long long comb(signed long long N_, signed long long C_) {
  const int NUM_ = 400001;
  static signed long long fact[NUM_ + 1], factr[NUM_ + 1], inv[NUM_ + 1];
  if (fact[0] == 0) {
    inv[1] = fact[0] = factr[0] = 1;
    for (int i = 2; i <= NUM_; ++i) inv[i] = inv[mo % i] * (mo - mo / i) % mo;
    for (int i = 1; i <= NUM_; ++i)
      fact[i] = fact[i - 1] * i % mo, factr[i] = factr[i - 1] * inv[i] % mo;
  }
  if (C_ < 0 || C_ > N_) return 0;
  return factr[C_] * fact[N_] % mo * factr[N_ - C_] % mo;
}
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N >> K;
  if (K == 0) {
    signed long long ret = 1;
    for (i = 0; i < (N); i++) ret = ret * (i + 1) % mo;
    cout << ret << endl;
    return;
  }
  if (K >= N) {
    cout << 0 << endl;
    return;
  }
  K = N - K;
  signed long long ret = 0;
  for (i = 1; i <= K; i++) {
    if ((K - i) % 2 == 0) {
      ret += modpow(i, N) * comb(K, i) % mo;
    } else {
      ret -= modpow(i, N) * comb(K, i) % mo;
    }
  }
  ret = (ret % mo * 2 * comb(N, K) % mo + mo) % mo;
  cout << ret << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
