using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static long LPow (long x, long n) { if (n == 0) return 1; return x * LPow(x, n - 1); } static void Main(string[] args) { // 一億(1000000000)桁のループが重すぎるので一億の位はデータをあらかじめ算出しておく long[] modlist = { 1, 927880474, 933245637, 668123525, 429277690, 733333339, 724464507, 957939114, 203191898, 586445753, 698611116 }; long n = Int64.Parse( Console.ReadLine() ); long m = LPow(10, 9) + 7; if (n >= m) { Console.WriteLine(0); return; } long ans = modlist[n / 100000000]; long n2 = n + 1; for (long i = n / 100000000 * 100000000 + 1; i < n2; ++i ) { ans = i * (ans % m); } long result; Math.DivRem(ans, m, out result); Console.WriteLine(result); } }