import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long si = n/2; long ue = n-si; BigInteger a = new BigInteger(si+""); BigInteger aa = a.add(new BigInteger("1")); BigInteger b = aa.multiply(new BigInteger(ue+"")); b = b.add(a); System.out.println(b.mod(new BigInteger("1000007"))); } }