import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long mod = (long)Math.pow(10,6)+7; long half = N/2; long a = (N-half)%mod; long b = (half+1)%mod; long c = half%mod; long max=(a*b+c)%mod; System.out.println(max); } }