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