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