#include <bits/stdc++.h>
using namespace std;
using ill = long long;
class solution {
 public:
  const ill mod = 998244353, maxN = 200000;
  ill quickPow(ill a, ill n, ill p) {
    ill ans = 1;
    while (n) {
      if (n & 1) ans = ans * a % p;
      a = a * a % p;
      n >>= 1;
    }
    return ans;
  }
  void solve() {
    ill n, k;
    cin >> n >> k;
    vector<ill> fac(n + 1, 1);
    for (ill x = 1; x <= n; ++x) fac[x] = (fac[x - 1] * x) % mod;
    vector<ill> ine(n + 1, -1);
    ine[n] = quickPow(fac[n], mod - 2, mod);
    for (ill x = n - 1; x >= 0; --x) ine[x] = (ine[x + 1] * (x + 1)) % mod;
    auto C = [&](ill a, ill b) {
      return ((fac[a] * ine[a - b]) % mod * ine[b]) % mod;
    };
    if (k == 0) {
      cout << fac[n] << '\n';
    } else if (k >= n) {
      cout << "0\n";
    } else {
      ill ans = 0, add = 1;
      for (ill ak = 0; k + ak <= n - 1; ++ak) {
        ans = (ans +
               (quickPow(n - k - ak, n, mod) * C(n - k, ak) * add + mod) % mod +
               mod) %
              mod;
        add *= -1;
      }
      ans = (ans * C(n, n - k) + mod) % mod;
      cout << (ans * 2 + mod) % mod << '\n';
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  solution sln1;
  sln1.solve();
  cout.flush();
  return 0;
}
