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); tmp = (i % mod) + tmp % mod; System.out.println(tmp % mod); } }