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 / 2 + 1) % MOD) * (n - n / 2 + 1) % MOD) + MOD - 1) % MOD; System.out.println(ans); } }