#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("avx2")
using namespace std;
const int mod = 998244353;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int mul(int a, int b) { return ((a)*1ll * (b)) % mod; }
void add(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
int sub(int a, int b) {
  a -= b;
  if (a < 0) {
    a += mod;
  }
  return a;
}
int powz(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) {
      res = mul(res, a);
    }
    b /= 2;
    a = mul(a, a);
  }
  return res;
}
template <typename A, typename B>
istream& operator>>(istream& input, pair<A, B>& x) {
  input >> x.first >> x.second;
  return input;
}
template <typename A>
istream& operator>>(istream& input, vector<A>& x) {
  for (auto& i : x) input >> i;
  return input;
}
template <typename A>
ostream& operator<<(ostream& output, vector<A>& x) {
  for (auto& i : x) output << i << ' ';
  return output;
}
const int N = 200005;
vector<int> fc, inv;
int nCr(int n, int r) {
  if (n < r) {
    return 0;
  }
  return mul(mul(fc[n], inv[r]), inv[n - r]);
}
void prec(int n) {
  fc.resize(n);
  inv.resize(n);
  fc[0] = 1;
  for (int i = 1; i < n; i++) {
    fc[i] = mul(fc[i - 1], i);
  }
  inv[n - 1] = powz(fc[n - 1], mod - 2);
  for (int i = n - 2; i >= 0; i--) {
    inv[i] = mul(inv[i + 1], i + 1);
  }
}
void solve() {
  int n;
  long long k;
  cin >> n >> k;
  if (k > n - 1) {
    cout << 0;
    return;
  }
  prec(200005);
  k = n - k;
  int ans = 0;
  for (int j = 0; j < k; j++) {
    if (j % 2 == 0) {
      add(ans, mul(nCr(k, j), powz(k - j, n)));
    } else {
      ans = sub(ans, mul(nCr(k, j), powz(k - j, n)));
    }
  }
  if (k != n) {
    ans = mul(ans, 2);
  }
  cout << mul(fc[k], mul(nCr(n, k), mul(ans, inv[k])));
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc = 1;
  for (int _ = 0; _ < tc; _++) {
    solve();
    if (_ != tc - 1) {
      cout << '\n';
    }
  }
}
