import java.util.Scanner; public class Yuki072 { public static void main(String[] args) { Yuki072 hoge = new Yuki072(); } Yuki072() { Scanner scanner = new Scanner(System.in); long N = scanner.nextLong(); long mod = 1000007L; long i = N / 2; long tmp = (((i + 1) % mod) * ((N - i) % mod)); System.out.println((i % mod) + tmp % mod); } }