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