D. New Year and the Permutation Concatenation
/**
题意:把 n 的所有排列按照字典序写在一起,问存在多少条长度为n的区间为n的一个全排列;
强行oeis打表 公式过程化简
*/
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod = 998244353;
int n;
int main() {
cin >> n;
if (n == 1) { cout << 1 << endl; return 0;}
ll minus = 2, fact = 1;
for (int i = 1; i <= n; i ++) fact = fact * i % mod;
for (int i = 3; i <= n; i ++) minus = 1LL * i * (minus + 1) % mod;
int ret = (1ll*fact * n % mod - minus + mod) % mod;
cout << ret << endl;
return 0;
}