#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const long long mod = 998244353;
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b /= 2;
  }
  return ans;
}
long long b[maxn], inv[maxn];
long long C(long long n, long long m) {
  if (m > n) return 0;
  return b[n] * inv[m] % mod * inv[n - m] % mod;
}
long long Lucas(long long n, long long m) {
  if (m == 0) return 1;
  return C(n % mod, m % mod) * Lucas(n / mod, m / mod) % mod;
}
long long S(long long n, long long m) {
  long long ans = 0;
  for (int k = 0; k <= m; k++) {
    if (k & 1)
      ans = (ans - C(m, k) * qpow(m - k, n) % mod + mod) % mod;
    else
      ans = (ans + C(m, k) * qpow(m - k, n) % mod) % mod;
  }
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m >= n)
    cout << 0 << endl;
  else {
    b[0] = 1;
    inv[0] = 1;
    for (int i = 1; i <= n; i++)
      b[i] = b[i - 1] * i % mod, inv[i] = qpow(b[i], mod - 2) % mod;
    long long ans = S(n, n - m) * C(n, n - m) % mod;
    if (m == 0)
      cout << ans << endl;
    else
      cout << ans * 2 % mod << endl;
  }
  return 0;
}
