import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); BigInteger max = BigInteger.ZERO; for (int i = 0; i < N; i++) { BigInteger upper = new BigInteger(String.valueOf(i)); BigInteger lower = new BigInteger(String.valueOf(N - i)); if (max.compareTo(upper.multiply(lower.add(BigInteger.ONE)).add(lower)) < 1) { max = upper.multiply(lower.add(BigInteger.ONE)).add(lower); } } System.out.println(max.mod(new BigInteger("1000007"))); } }