#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *r) -> decltype(cerr << *r);
template <class c>
char dud(...);
struct muu {
  template <class c>
  muu &operator<<(const c &) {
    return *this;
  }
};
using pii = pair<int, int>;
using ld = long double;
using ll = long long;
ll silnia[1000007];
const int mod = 998244353;
ll binpow(ll a, int n) {
  ll ret = 1;
  while (n != 0) {
    if (n % 2 == 1) {
      ret *= a;
      ret %= mod;
    }
    a *= a;
    a %= mod;
    n /= 2;
  }
  return ret;
}
ll dwumian(int n, int k) {
  return (((silnia[n] * binpow(silnia[k], mod - 2)) % mod) *
          binpow(silnia[n - k], mod - 2)) %
         mod;
}
int main() {
  int N, K;
  scanf("%d%d", &N, &K);
  silnia[0] = 1;
  for (int i = 1; i <= N; i++) {
    silnia[i] = (i * silnia[i - 1]) % mod;
  }
  if (K >= N) {
    printf("0\n");
    return 0;
  }
  int ile = N - K;
  ll wyn = dwumian(N, ile);
  ll ziomo = 0;
  for (int i = 1; i <= ile; i++) {
    ll ter = binpow(i, N - 1);
    ter *= binpow((silnia[i - 1] * silnia[ile - i]) % mod, mod - 2);
    ter %= mod;
    if ((ile - i) % 2 == 0) {
      ziomo += ter;
    } else {
      ziomo -= ter;
    }
    ziomo %= mod;
  }
  muu() << __FUNCTION__ << "#" << 89 << ": " << ziomo;
  ziomo *= silnia[ile];
  ziomo %= mod;
  ziomo += mod;
  ziomo %= mod;
  wyn *= ziomo;
  if (K != 0) wyn *= 2;
  wyn %= mod;
  printf("%lld", wyn);
  return 0;
}
