using System; public class Hello { public const int MOD = 1000000007; public static void Main() { var n = int.Parse(Console.ReadLine().Trim()); if (n == 1) { Console.WriteLine(1); goto end; } var b1 = 0L; var b2 = 0L; var pre = 1L; for (int i = 2; i <= n; i++) { if (i % 2 == 0) { var w = (i * (pre + b2)) % MOD; b2 += pre; b2 %= MOD; pre = w; } else { var w = (i * (pre + b1)) % MOD; b1 += pre; b1 %= MOD; pre = w; } } Console.WriteLine(pre); end:; } }