using System; internal static class Program { private static readonly int _mod = 1000007; private static long Calculate(long first, long second) { return ((second + 1) % _mod) * (first % _mod) + second % _mod; } public static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); if (n%2 == 1) { var first = Calculate(n / 2 + 1, n / 2) % _mod; var second = Calculate(n / 2, n / 2 + 1) % _mod; Console.WriteLine(Math.Max(first, second)); } else { Console.WriteLine(Calculate(n/2,n/2)%_mod); } } }