using System.Collections.Generic;
using System.Numerics;
using System;

public class Hello
{
    public const int MOD = 1000007;
    public static void Main()
    {
        var n =  BigInteger.Parse(Console.ReadLine().Trim());
        var a = new List<BigInteger>();
        a.Add(n / 2L);  a.Add(n / 2L + 1);  a.Add(n / 2L - 1);
        BigInteger ans = 0;
        foreach (var x in a)
        {
            BigInteger t = -x * x + n * x + n;
            ans = BigInteger.Max(ans, t);
        }
        ans %= MOD;
        Console.WriteLine(ans);
    }
}