import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); long n=sc.nextLong(),m=1000007,a,b,c; sc.close(); a=(n+1)/2%m; b=(n/2+1)%m; c=n/2%m; System.out.print((a*b%m+c)%m); } }