#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  long long l = v.size();
  for (long long i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << '\n';
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const double EPS = 1e-9;
const long long N = 500005;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rand(long long l, long long r) {
  uniform_int_distribution<long long> uid(l, r);
  return uid(rng);
}
long long n, k;
long long fact[200001];
long long mod = 998244353;
long long power(long long a, long long b) {
  long long ret = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      ret *= a;
      ret %= mod;
    }
    b /= 2;
    a *= a;
    a %= mod;
  }
  return ret % mod;
}
long long inv(long long a) { return power(a, mod - 2); }
long long C(long long n, long long k) {
  return (fact[n] * inv((fact[n - k] * fact[k]) % mod)) % mod;
}
void solve(long long x) {
  cin >> n >> k;
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= mod;
  }
  if (k > n - 1) {
    cout << 0 << '\n';
    return;
  }
  long long c = n - k;
  long long ans = 0;
  for (long long i = c; i >= 0; i--) {
    if (i % 2 == c % 2) {
      ans += ((C(c, i) * power(i, n)) % mod);
      ans %= mod;
    } else {
      ans -= ((C(c, i) * power(i, n)) % mod);
      ans += mod;
      ans %= mod;
    }
  }
  ans *= C(n, c);
  ans %= mod;
  ans = ans * (k == 0 ? 1 : 2);
  ans %= mod;
  cout << ans << '\n';
}
int32_t main() {
  long long t;
  t = 1;
  long long i = 0;
  while (i < t) {
    solve(i + 1);
    i++;
  }
}
