#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, flag = 1;
  char c = getchar();
  while ((c > '9' || c < '0') && c != '-') c = getchar();
  if (c == '-') flag = 0, c = getchar();
  while (c <= '9' && c >= '0') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return flag ? x : -x;
}
const int maxn = 1e6 + 5, M = 998244353;
int n, m, jie[maxn], jie_[maxn];
long long k;
int ksm(int x, int k) {
  if (x <= 0) return 0;
  int ret = 1;
  while (k) {
    if (k & 1) ret = 1ll * ret * x % M;
    x = 1ll * x * x % M;
    k >>= 1;
  }
  return ret;
}
int C(int n, int m) {
  if (m >= n || !m) return 1;
  return 1ll * jie[n] * jie_[m] % M * jie_[n - m] % M;
}
int main() {
  jie[0] = jie_[0] = 1;
  for (int i = (1); i <= (int)(200000); i++) {
    jie[i] = 1ll * jie[i - 1] * i % M;
    jie_[i] = ksm(jie[i], M - 2);
  }
  cin >> n >> k;
  if (k >= n) return puts("0"), 0;
  m = n - k;
  long long ans = 0;
  for (int i = (0); i <= (int)(m); i++) {
    int x = 1ll * C(m, i) * ksm(m - i, n) % M;
    if (i & 1) x = -x;
    ans += x;
  }
  ans %= M;
  ans = ans * C(n, m) % M;
  if (k) ans = ans * 2 % M;
  cout << (ans % M + M) % M;
  return 0;
}
