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=-k*k+n*k+n; out.println(ans%MOD); out.flush(); } } }