#include <bits/stdc++.h>
using namespace std;
long long int modpow(long long int a, long long int b,
                     long long int m = 998244353) {
  a %= m;
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long int bpow(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long int modinv(long long int a, long long int m = 998244353) {
  return modpow(a, m - 2, m);
}
void graph(vector<vector<long long int> > &adj, long long int m) {
  long long int x, y;
  for (long long int i = 0; i < m; i++) {
    cin >> x >> y;
    adj[--x].push_back(--y);
    adj[y].push_back(x);
  }
}
long long int MAX = 2 * (1e+5) + 10;
vector<long long int> f(MAX);
vector<long long int> invf(MAX);
long long int ncr(long long int n, long long int r) {
  return invf[n - r] * (f[n] * invf[r] % 998244353) % 998244353;
}
void solve() {
  f[0] = 1;
  for (long long int i = 1; i <= MAX - 1; i++)
    f[i] = (f[i - 1] * i) % 998244353;
  for (long long int i = 0; i < MAX; i++) invf[i] = modinv(f[i]);
  long long int n, k;
  cin >> n >> k;
  long long int m = n - k;
  if (m < 1 || m > n) {
    cout << 0 << '\n';
    return;
  }
  long long int answer = 0;
  for (long long int i = 1; i <= m; i++) {
    long long int s = ((m - i) % 2 ? -1 : 1);
    answer = (answer + s * modpow(i, n) * ncr(m, i)) % 998244353;
  }
  answer = (answer + 998244353) % 998244353;
  if (m != n) answer = (answer * 2) % 998244353;
  cout << answer * ncr(n, m) % 998244353 << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) solve();
}
