#include <bits/stdc++.h>
using namespace std;
long long N, K;
const long long MD = 998244353;
class CombinatoricHelper {
 private:
  long long MD;

 public:
  int lim;
  long long quickPower(long long base, long long pw) {
    if (pw == 0) return 1;
    if (pw == 1) return base;
    long long ret = quickPower(base, pw / 2);
    ret = (ret * ret) % MD;
    if (pw % 2 == 0)
      return ret;
    else
      return (ret * base) % MD;
  }
  long long getInverse(long long a) { return quickPower(a, MD - 2); }

 private:
  vector<long long> fact;
  vector<long long> rfact;

 public:
  long long getSelection(int n, int k) {
    if (k > n) return 0;
    if (k == 0) return 1;
    if (k == n) return 1;
    long long ret = fact[n];
    ret *= rfact[n - k];
    ret %= MD;
    ret *= rfact[k];
    ret %= MD;
    return ret;
  }

 public:
  void preProcess(int desiredLimit, long long mod) {
    MD = mod;
    lim = desiredLimit;
    fact = vector<long long>(lim + 7);
    rfact = vector<long long>(lim + 7);
    fact[0] = 1;
    for (int i = 1; i <= lim; i++) fact[i] = (fact[i - 1] * i) % MD;
    rfact[lim] = getInverse(fact[lim]);
    for (int i = lim - 1; i >= 0; i--) rfact[i] = (rfact[i + 1] * (i + 1)) % MD;
  }
  void preProcess(int desiredLimit) { preProcess(desiredLimit, 998244353); }
  long long getFact(int n) { return fact[n]; }
} chelper;
int testRun() {
  int n = 4;
  int cnt[n + 1];
  for (int i = 1; i <= n; i++) cnt[i] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      for (int k = 0; k < n; k++)
        for (int l = 0; l < n; l++) {
          set<int> q;
          q.insert(i);
          q.insert(j);
          q.insert(k);
          q.insert(l);
          cnt[q.size()]++;
        }
  for (int i = 1; i <= n; i++) printf("%d elements: %d ways\n", i, cnt[i]);
  return 0;
}
long long solve(long long n, long long k) {
  long long ret = 0;
  for (int j = 0; j <= k; j++) {
    long long thisRound = 1;
    if ((k - j) % 2 == 1) thisRound = -1;
    thisRound *= chelper.getSelection(k, j);
    thisRound %= MD;
    thisRound *= chelper.quickPower(j, n);
    thisRound %= MD;
    ret += thisRound;
    ret %= MD;
  }
  ret *= chelper.getSelection(n, k);
  ret %= MD;
  return ret;
}
int main() {
  chelper.preProcess(300007, MD);
  scanf("%lld%lld", &N, &K);
  if (K >= N) {
    printf("0\n");
    return 0;
  }
  if (K == 0) {
    long long ans = chelper.getFact(N);
    printf("%lld\n", ans % MD);
    return 0;
  }
  long long ans = solve(N, N - K) % MD;
  ans *= 2;
  ans %= MD;
  if (ans < 0) ans += MD;
  printf("%lld\n", ans % MD);
  return 0;
}
