using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var mod = 998_244_353; var ans = 0L; var k = 1L; var pk = 1L; var add = 1L; int half = 499122177; for (var i = 2; i <= n; ++i) { ans = (ans * (i + 1) + k + add * pk % mod) % mod; pk = k; k = k * i % mod; add = (add + (long)i * (i + 1) % mod * half % mod) % mod; } WriteLine(ans); } }