import java.util.Scanner; public class Yukicoder72 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long up = (n / 2) % 1000007; long down = (n - up) % 1000007; long res = (down + 1) * up % 1000007 + down; System.out.println(res % 1000007); } }