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