import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); BigInteger N = new BigInteger(scanner.next()); BigInteger two = new BigInteger("2"); BigInteger three = new BigInteger("3"); BigInteger mod = new BigInteger("1000007"); System.out .println((N.add(three).divide(two).multiply(N.add(two).divide(two)).subtract(BigInteger.ONE)).mod(mod)); } }