#include <bits/stdc++.h>
using namespace std;
int quickPow(int n, int m, int base = 998244353) {
  int n2k = n, ans = 1;
  while (m) {
    if (m & 1) ans = (ans * (long long)n2k) % base;
    m >>= 1;
    n2k = (n2k * (long long)n2k) % base;
  }
  return ans;
}
inline int reciprocal(int n, int base = 998244353) {
  return quickPow(n, base - 2);
}
vector<int> factorial;
inline int combi(int a, int b) {
  return (long long)factorial[b] * reciprocal(factorial[b - a]) % 998244353 *
         reciprocal(factorial[a]) % 998244353;
}
int main() {
  int n, k;
  cin >> n >> k;
  factorial = vector<int>(1 + n);
  factorial[0] = 1;
  for (int i = 1; i <= n; ++i)
    factorial[i] = (factorial[i - 1] * (long long)i) % 998244353;
  if (!k)
    cout << factorial[n] << endl;
  else if (k >= n)
    cout << 0 << endl;
  else {
    int ans = 0, c = n - k;
    for (int i = 0; i <= c; ++i) {
      ans += (998244353 + quickPow(-1, i) * combi(i, c)) % 998244353 *
             (long long)quickPow(c - i, n) % 998244353;
      ans %= 998244353;
    }
    cout << 2LL * combi(k, n) * ans % 998244353 << endl;
  }
  return 0;
}
