import java.util.*;
import java.math.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger mod = BigInteger.valueOf(1000007);
		long n = sc.nextLong();
		BigInteger ans = BigInteger.valueOf(n / 2 + 1).multiply(BigInteger.valueOf(n - n / 2 + 1)).subtract(BigInteger.ONE).mod(mod);
		System.out.println(ans);
   }
}