MOD = 998244353 n = int(input()) ans = (n - 1) * n * (n + 4) // 6 for i in range(1, n): ans *= i ans %= MOD print(ans)