#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5 + 10;
long long MOD = 998244353;
long long fac[MAXN], inv[MAXN];
long long fpow(long long base, long long exp) {
  long long result = 1;
  while (exp) {
    if (exp & 1) result = (result * base) % MOD;
    exp >>= 1;
    base = (base * base) % MOD;
  }
  return result;
}
long long cmb(long long n, long long k) {
  return fac[n] * inv[n - k] % MOD * inv[k] % MOD;
}
long long stirling(long long k, long long n) {
  if (k == 0 && n == 0) return 1;
  if (n == 0) return 0;
  if (k < n) return 0;
  long long ans = 0;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    long long now = cmb(n, i) * fpow(n - i, k) % MOD;
    if (i & 1)
      ans = (ans - now + MOD) % MOD;
    else
      ans = (ans + now) % MOD;
  }
  ans = ans * inv[n] % MOD;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1, ThxDem = MAXN; i < ThxDem; ++i)
    fac[i] = fac[i - 1] * i % MOD, inv[i] = fpow(fac[i], MOD - 2);
  long long n, k;
  cin >> n >> k;
  long long am = -1;
  for (int i = 1, ThxDem = n + 1; i < ThxDem; ++i)
    if (n - i == k) am = i;
  if (am < 0) cout << "0\n", exit(0);
  long long now = stirling(n, am) * fac[am] % MOD;
  now = now * cmb(n, am) % MOD;
  if (am != n) now = now * 2 % MOD;
  cout << now << "\n";
}
