using System; using System.Collections.Generic; class P { static void Main(string[] _) { UInt64 n = UInt64.Parse(Console.ReadLine()); UInt64 r = 1; for (UInt64 i = n % 1000000007; i >= 1; i--) { r = r * i % 1000000007; } Console.WriteLine(r); } }