import java.util.Scanner; public class Main_yukicoder72 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long MOD = 1000007; long n = sc.nextLong(); long i = n / 2; long max = ((i + 1) % MOD) * ((n - i + 1) % MOD) + MOD - 1; System.out.println(max % MOD); sc.close(); } }