#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); constexpr long long MOD = 998244353; int n, k; cin >> n >> k; // S_2 has only the identity automorphism. if (n == 2) { cout << 1 << '\n'; return 0; } // S_6 also has outer automorphisms. The condition only fixes // the specified k-cycle, not the action on all remaining points. if (n == 6) { constexpr int answer[7] = {0, 0, 192, 54, 16, 10, 6}; cout << answer[k] << '\n'; return 0; } // For all other n >= 3, count permutations commuting with (1 ... k). long long answer = k; for (int i = 2; i <= n - k; ++i) { answer = answer * i % MOD; } cout << answer << '\n'; return 0; }