#include <bits/stdc++.h>
using namespace std;
const int Z = 998244353;
int bexp(int a, int x) {
  if (x == 0) return 1;
  if (x % 2 == 1) return 1ll * a * bexp(a, x - 1) % Z;
  int t = bexp(a, x / 2);
  return 1ll * t * t % Z;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  long long k;
  cin >> n >> k;
  int fac[n + 1], ifac[n + 1], inv[n + 1];
  for (int i = 0; i <= n; i++) {
    inv[i] = i <= 1 ? i : 1ll * (Z - Z / i) * inv[Z % i] % Z;
    fac[i] = i == 0 ? 1 : 1ll * i * fac[i - 1] % Z;
    ifac[i] = i == 0 ? 1 : 1ll * inv[i] * ifac[i - 1] % Z;
  }
  if (k == 0) {
    cout << fac[n] << endl;
    return 0;
  }
  if (k >= n) {
    cout << 0 << endl;
    return 0;
  }
  int t = 0;
  for (int i = n - k, p = 1; i >= 1; i--, p *= -1) {
    t = ((t + 1ll * bexp(i, n) * p * fac[n - k] % Z * ifac[i] % Z *
                  ifac[n - k - i]) %
             Z +
         Z) %
        Z;
  }
  cout << 2ll * t * fac[n] % Z * ifac[k] % Z * ifac[n - k] % Z << endl;
  return 0;
}
