import java.io.*; class Main{ static final PrintWriter out=new PrintWriter(System.out); static long MOD=1000007; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()){ long n=Long.parseLong(line); long k=(long)n/2; long ans=(((n-k)%MOD)*(k%MOD)+n%MOD)%MOD; out.println(ans); out.flush(); } } }