#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
const int N = 5e5 + 100;
const int MOD = 998244353;
void add(int& a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
int mul(int a, int b) { return (long long)a * b % MOD; }
int mpow(int a, int n) {
  int res = 1;
  for (; n > 0; n >>= 1) {
    if (n & 1) res = mul(res, a);
    a = mul(a, a);
  }
  return res;
}
int inv(int a) { return mpow(a, MOD - 2); }
int fact[N];
int invfact[N];
int C(int n, int k) { return mul(fact[n], mul(invfact[k], invfact[n - k])); }
int stirling(int n, int k) {
  int ans = 0;
  for (int i = 0; i <= k; i++) {
    if (i & 1) {
      add(ans, MOD - mul(C(k, i), mpow(k - i, n)));
    } else {
      add(ans, mul(C(k, i), mpow(k - i, n)));
    }
  }
  return mul(ans, invfact[k]);
}
void solve(int tc) {
  int n, k;
  cin >> n >> k;
  if (k >= n) {
    cout << 0 << '\n';
    return;
  }
  int parts = n - k;
  int ans = mul(mul(stirling(n, parts), fact[parts]), mul(2, C(n, n - parts)));
  if (k == 0) {
    ans = mul(ans, invfact[2]);
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(10) << fixed;
  fact[0] = invfact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = mul(fact[i - 1], i);
    invfact[i] = mul(invfact[i - 1], inv(i));
  }
  solve(1);
}
