#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
const long long N = 100005;
const long long M = 200006;
long long f[M], inv[M];
long long expo(long long base, long long exponent, long long mod) {
  long long ans = 1;
  while (exponent != 0) {
    if (exponent & 1) ans = (1LL * ans * base) % mod;
    base = (1LL * base * base) % mod;
    exponent >>= 1;
  }
  return ans % mod;
}
void compute() {
  f[0] = 1;
  for (long long i = 1; i <= M - 1; i++) {
    f[i] = (1LL * i * f[i - 1]) % 998244353;
  }
  inv[M - 1] = expo(f[M - 1], 998244353 - 2, 998244353);
  for (long long i = M - 2; i >= 0; i--) {
    inv[i] = (1LL * (i + 1) * inv[i + 1]) % 998244353;
  }
}
long long C(long long n, long long r) {
  return (1LL * ((1LL * f[n] * inv[r]) % 998244353) * inv[n - r]) % 998244353;
}
void solve() {
  compute();
  long long n, k;
  cin >> n >> k;
  if (k >= n) {
    cout << 0 << '\n';
    return;
  }
  long long maxx = n - k;
  long long ans = 0;
  long long temp = C(n, maxx);
  for (long long i = 0; i <= maxx; i++) {
    if (i % 2 == 0) {
      ans = (ans + (C(maxx, i) * expo(maxx - i, n, 998244353)) % 998244353) %
            998244353;
    } else {
      ans = (ans - (C(maxx, i) * expo(maxx - i, n, 998244353)) % 998244353 +
             998244353) %
            998244353;
    }
  }
  ans = (ans * temp) % 998244353;
  if (k) ans = (ans * 2) % 998244353;
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long TESTS = 1;
  while (TESTS--) {
    solve();
  }
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
